How to Use MCP Developer in Claude Code: A Beginner's Guide
Purpose
This post demonstrates how to use MCP Developer skill in Claude Code for API architecture development.
Environment
- Claude Code with claude-skills plugin
- MCP (Model Context Protocol) SDK
- Node.js or Python runtime
- Beginner to intermediate development experience
What is MCP Developer?
MCP Developer is a skill in Claude Code that helps you build, test, and deploy MCP servers. MCP servers extend Claude’s capabilities by providing tools, resources, and prompts through a standardized protocol.
When I work with MCP Developer, I get help with:
- Server scaffolding and setup
- Tool implementation
- Resource management
- Prompt template creation
- Testing and validation
- Deployment configuration
Installation and Setup
First, I need to install the claude-skills plugin. Here’s how I did it:
# Install claude-skills globallynpm install -g @jeffallan/claude-skills
# Verify installationclaude-skills --versionI got this output:
claude-skills v1.2.0Then I activated MCP Developer in my Claude Code configuration:
{ "skills": [ "mcp-developer" ], "skillsPath": "~/.claude/skills"}Core Usage Patterns
MCP Developer activates when I use specific trigger phrases. Here are common ones:
- “Create an MCP server for…”
- “Add a tool to my MCP server”
- “Test my MCP server”
- “Deploy MCP server to…”
The skill helps with scaffold-level tasks:
┌─────────────┐ ┌─────────────┐ ┌─────────────┐│ Prompt │───▶│ MCP Server │───▶│ Claude Tool ││ │ │ Generation │ │ Access │└─────────────┘ └─────────────┘ └─────────────┘ │ ▼ ┌─────────────┐ │ Testing & │ │ Validation │ └─────────────┘Practical Examples
Example 1: Creating an MCP Server
When I ask: “Create an MCP server that fetches weather data”
MCP Developer generates this structure:
import { Server } from '@modelcontextprotocol/sdk/server/index.js'import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'import { CallToolRequestSchema, ListToolsRequestSchema,} from '@modelcontextprotocol/sdk/types.js'
const server = new Server( { name: 'weather-server', version: '0.1.0', }, { capabilities: { tools: {}, }, })
// List available toolsserver.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ { name: 'get_weather', description: 'Get current weather for a location', inputSchema: { type: 'object', properties: { location: { type: 'string', description: 'City name or zip code', }, }, required: ['location'], }, }, ], }})
// Handle tool executionserver.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params
if (name === 'get_weather') { const location = args?.location as string // Weather API logic here return { content: [ { type: 'text', text: `Weather data for ${location}`, }, ], } }
throw new Error(`Unknown tool: ${name}`)})
async function main() { const transport = new StdioServerTransport() await server.connect(transport)}
main().catch(console.error)Example 2: Adding Resources
When I add a resource to the server:
// Add resource schemaserver.setRequestHandler(ListResourcesRequestSchema, async () => { return { resources: [ { uri: 'weather://forecast/{location}', name: 'Weather Forecast', description: 'Extended weather forecast', mimeType: 'application/json', }, ], }})
// Handle resource readingserver.setRequestHandler(ReadResourceRequestSchema, async (request) => { const url = new URL(request.params.uri) const location = url.pathname.replace('/weather/forecast/', '')
return { contents: [ { uri: request.params.uri, mimeType: 'application/json', text: JSON.stringify({ location, forecast: [], // Forecast data }), }, ], }})Example 3: Testing the Server
I test the MCP server using the MCP Inspector:
# Install MCP Inspectornpm install -g @modelcontextprotocol/inspector
# Run the server with inspectornpx mcp-inspector node weather-server/src/index.tsI get this output:
MCP Inspector running at http://localhost:5173Server connected: weather-server v0.1.0Available tools: - get_weatherBest Practices
DO
Version your server properly
{ "name": "weather-server", "version": "0.1.0"}Validate all inputs
const schema = { type: 'object', properties: { location: { type: 'string' }, }, required: ['location'],}
const validated = inputSchema.parse(args)Handle errors gracefully
try { const result = await fetchWeather(location) return { content: [{ type: 'text', text: result }] }} catch (error) { return { content: [{ type: 'text', text: `Error fetching weather: ${error.message}` }], isError: true, }}Use proper transport
// For local developmentconst transport = new StdioServerTransport()
// For HTTP deploymentconst transport = new SSEServerTransport('/message', res)DON’T
Don’t skip input validation
// WRONGconst location = args.location // Could be undefined
// CORRECTconst location = args?.locationif (!location) { throw new Error('location is required')}Don’t hardcode secrets
// WRONGconst apiKey = 'sk-proj-xxxxx'
// CORRECTconst apiKey = process.env.WEATHER_API_KEYDon’t forget error handling
// WRONGconst data = await fetch(url)return JSON.parse(data)
// CORRECTtry { const response = await fetch(url) if (!response.ok) { throw new Error(`HTTP ${response.status}`) } return await response.json()} catch (error) { console.error('Fetch failed:', error) throw error}Don’t ignore tool descriptions
// WRONGdescription: 'Tool' // Not helpful
// CORRECTdescription: 'Get current weather for a location using city name or zip code'Common Issues
Issue 1: Server Not Found
When I run:
npx mcp-inspector node weather-server/src/index.tsI get this error:
Error: Cannot find module './index.ts'The fix is to use the correct path:
npx mcp-inspector --node-arg=--loader ts-node/esm weather-server/src/index.tsIssue 2: Tools Not Appearing
When tools don’t show up in Inspector, I check the ListTools handler:
// Missing return causes tools to not appearserver.setRequestHandler(ListToolsRequestSchema, async () => { // I forgot to return the tools object})
// Correct versionserver.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [...] // Must return this }})Issue 3: Type Errors
When I get TypeScript errors:
error TS2345: Argument of type 'string' is not assignable to parameter of type 'Tool'I fix the type imports:
// Correct imports from SDKimport type { Tool } from '@modelcontextprotocol/sdk/types.js'
const tool: Tool = { name: 'get_weather', description: '...', inputSchema: {...}}Related Skills
MCP Developer works well with these skills:
- planning-with-files: For complex MCP server architecture
- tdd-workflow: For test-driven MCP tool development
- code-review: For validating MCP server code quality
Summary
In this post, I showed how to use MCP Developer skill in Claude Code for API architecture development. The key points are:
- MCP Developer helps scaffold, test, and deploy MCP servers
- Use proper input validation and error handling
- Test with MCP Inspector before deployment
- Follow MCP protocol specifications closely
- Integrate with other Claude Code skills for better workflow
MCP servers extend Claude’s capabilities through a standardized protocol. With MCP Developer, I can build tools, resources, and prompts that integrate seamlessly with Claude’s interface.
Final Words + More Resources
My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me
Here are also the most important links from this article along with some further resources that will help you in this scope:
- 👨💻 Claude Skills Documentation
- 👨💻 Claude Skills GitHub Repository
- 👨💻 Model Context Protocol Specification
Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!
Comments