Skip to content

Commit bdb1dd9

Browse files
authored
Merge pull request #10 from bucketeer-io/fix/doc
chore: fix tool format
2 parents 2cbec7d + 46f192c commit bdb1dd9

File tree

6 files changed

+26
-20
lines changed

6 files changed

+26
-20
lines changed

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,20 @@ The server automatically fetches and indexes documentation from the [bucketeer-i
7272

7373
Configure the MCP Server by adding the following to your `mcp.json` or `claude_desktop_config.json` file, referring to the documentation for Cursor (https://docs.cursor.com/context/model-context-protocol#configuring-mcp-servers) and Claude Desktop (https://modelcontextprotocol.io/quickstart/user):
7474

75+
**Option 1: Using npm (Recommended)**
76+
```json
77+
{
78+
"mcpServers": {
79+
"bucketeer-docs": {
80+
"type": "stdio",
81+
"command": "npm",
82+
"args": ["start", "--prefix", "/path/to/bucketeer-docs-local-mcp-server"]
83+
}
84+
}
85+
}
86+
```
87+
88+
**Option 2: Using node directly**
7589
```json
7690
{
7791
"mcpServers": {
@@ -89,14 +103,14 @@ Configure the MCP Server by adding the following to your `mcp.json` or `claude_d
89103

90104
When the MCP server is running, the following tools are available:
91105

92-
### 1. `search-docs` - Search Bucketeer Documentation
106+
### 1. `search_docs` - Search Bucketeer Documentation
93107
- **Parameter**: `query` (string) - The search query
94108
- **Parameter**: `limit` (number, optional) - Maximum number of results to return (default: 5)
95109

96110
**Example**:
97111
```json
98112
{
99-
"name": "search-docs",
113+
"name": "search_docs",
100114
"arguments": {
101115
"query": "feature flags SDK integration",
102116
"limit": 5
@@ -106,13 +120,13 @@ When the MCP server is running, the following tools are available:
106120

107121
**Response**: Returns an array of search results with title, URL, path, description, excerpt, and relevance score.
108122

109-
### 2. `get-document` - Get Specific Document Content
123+
### 2. `get_document` - Get Specific Document Content
110124
- **Parameter**: `path` (string) - Document path obtained from search results
111125

112126
**Example**:
113127
```json
114128
{
115-
"name": "get-document",
129+
"name": "get_document",
116130
"arguments": {
117131
"path": "getting-started/create-feature-flag"
118132
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bucketeer-docs-local-mcp-server",
3-
"version": "1.0.0",
3+
"version": "0.0.1",
44
"description": "Local MCP Server to query Bucketeer documentation",
55
"main": "dist/main.js",
66
"type": "module",

src/core/indexing/githubDocumentFetcher.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ export class GithubDocumentFetcher {
181181
`Error listing GitHub repository files from ${directory}:`,
182182
error.message
183183
);
184-
// 型ガードでerrorがオブジェクトかつ'response'プロパティを持つ場合のみ処理
185184
if (
186185
typeof error === 'object' &&
187186
error !== null &&

src/main.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,4 @@ async function main() {
1515
}
1616
}
1717

18-
const scriptPath = fileURLToPath(import.meta.url);
19-
const isDirectRun =
20-
process.argv[1] &&
21-
(process.argv[1] === scriptPath || process.argv[1].endsWith('/dist/main.js'));
22-
23-
if (isDirectRun) {
24-
main();
25-
}
18+
main();

src/mcp/tools/getDocumentTool.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ type McpTextContent = { type: 'text'; text: string };
55

66
export function createGetDocumentTool(searchService: SearchService) {
77
return {
8-
name: 'get-document',
8+
name: 'get_document',
99
description:
1010
'Retrieve the full content of a specific document by its path.',
1111
inputSchema: z.object({
@@ -14,7 +14,7 @@ export function createGetDocumentTool(searchService: SearchService) {
1414
execute: async ({ path }: { path: string }) => {
1515
try {
1616
console.error(
17-
`[MCP Tool] Received get-document request for path: "${path}"`
17+
`[MCP Tool] Received get_document request for path: "${path}"`
1818
);
1919
const document = searchService.getDocument(path);
2020

@@ -33,7 +33,7 @@ export function createGetDocumentTool(searchService: SearchService) {
3333
return { content: [responseContent] };
3434
} catch (error) {
3535
console.error(
36-
`[MCP Tool] Error processing get-document request for path "${path}":`,
36+
`[MCP Tool] Error processing get_document request for path "${path}":`,
3737
error
3838
);
3939
const errorMessage =

src/mcp/tools/searchTool.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ type McpTextContent = { type: 'text'; text: string };
66

77
export function createSearchTool(searchService: SearchService) {
88
return {
9-
name: 'search-docs',
9+
name: 'search_docs',
1010
description: 'Search for relevant documents in the documentation.',
1111
inputSchema: z.object({
1212
query: z.string().describe('The search query.'),
@@ -19,7 +19,7 @@ export function createSearchTool(searchService: SearchService) {
1919
execute: async ({ query, limit }: { query: string; limit?: number }) => {
2020
try {
2121
console.error(
22-
`[MCP Tool] Received search-docs request: "${query}" (limit: ${limit})`
22+
`[MCP Tool] Received search_docs request: "${query}" (limit: ${limit})`
2323
);
2424
const results = await searchService.search(
2525
query,
@@ -32,7 +32,7 @@ export function createSearchTool(searchService: SearchService) {
3232
return { content: [responseContent] };
3333
} catch (error) {
3434
console.error(
35-
`[MCP Tool] Error processing search-docs request for "${query}":`,
35+
`[MCP Tool] Error processing search_docs request for "${query}":`,
3636
error
3737
);
3838
const errorMessage =

0 commit comments

Comments
 (0)