-
Notifications
You must be signed in to change notification settings - Fork 0
feat(templates): add MCP server project template #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: p6/templates/cli
Are you sure you want to change the base?
Conversation
e41a0ed to
ffb2001
Compare
3795598 to
aacdccc
Compare
ffb2001 to
08c120b
Compare
aacdccc to
4eb91cd
Compare
08c120b to
218d1dc
Compare
Greptile Summary
|
| Filename | Overview |
|---|---|
| templates/mcp/src/mcp.ts.template | Core MCP server implementation with tool registration and request handling logic |
| templates/mcp/package.json.template | Project dependencies and build configuration including MCP SDK and @outfitter packages |
| templates/mcp/src/server.ts.template | Bun-based entry point using StdioServerTransport for MCP server execution |
Confidence score: 4/5
- This PR is safe to merge with low risk as it adds new template files without affecting existing functionality
- Score reflects well-structured template implementation following project conventions, though minor improvements could be made to error handling patterns and type safety in the tool dispatch logic
- Pay close attention to
templates/mcp/src/mcp.ts.templatefor the string-based tool dispatch pattern and ensure it follows best practices
Sequence Diagram
sequenceDiagram
participant User as "User"
participant Claude as "Claude Desktop"
participant Server as "MCP Server"
participant Transport as "StdioServerTransport"
User->>Claude: "Request using hello tool"
Claude->>Server: "ListToolsRequest"
Server->>Claude: "Return available tools (hello)"
Claude->>Transport: "CallToolRequest (hello, args)"
Transport->>Server: "Route tool call"
Server->>Server: "Process hello tool with name parameter"
Server->>Transport: "Return greeting response"
Transport->>Claude: "Tool response with greeting text"
Claude->>User: "Display greeting result"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8 files reviewed, 1 comment
| "noEmit": true, | ||
| "declaration": true, | ||
| "declarationDir": "dist", | ||
| "outDir": "dist", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Setting noEmit: true while also configuring declaration: true and output directories creates conflicting intentions - declarations won't be generated when noEmit is enabled
| "noEmit": true, | |
| "declaration": true, | |
| "declarationDir": "dist", | |
| "outDir": "dist", | |
| "declaration": true, | |
| "declarationDir": "dist", | |
| "outDir": "dist", |
Should this template support declaration generation for distribution, or is it purely for development with noEmit?
Prompt To Fix With AI
This is a comment left during a code review.
Path: templates/mcp/tsconfig.json.template
Line: 9:12
Comment:
**logic:** Setting `noEmit: true` while also configuring `declaration: true` and output directories creates conflicting intentions - declarations won't be generated when noEmit is enabled
```suggestion
"declaration": true,
"declarationDir": "dist",
"outDir": "dist",
```
Should this template support declaration generation for distribution, or is it purely for development with noEmit?
How can I resolve this? If you propose a fix, please make it concise.- package.json with MCP SDK and @outfitter deps - StdioServerTransport entry point - Sample hello tool implementation - Claude Desktop config in README Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
4eb91cd to
dae8a2d
Compare
218d1dc to
9e371ae
Compare
|
Tightened tool dispatch in the template: added a small handler map, argument guards/defaults, and a warn log for unknown tools. Restacked and resubmitted. |

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com