Skip to content

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:

Terminal window
# Install claude-skills globally
npm install -g @jeffallan/claude-skills
# Verify installation
claude-skills --version

I got this output:

Terminal window
claude-skills v1.2.0

Then I activated MCP Developer in my Claude Code configuration:

~/.claude/settings.json
{
"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:

weather-server/src/index.ts
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 tools
server.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 execution
server.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 schema
server.setRequestHandler(ListResourcesRequestSchema, async () => {
return {
resources: [
{
uri: 'weather://forecast/{location}',
name: 'Weather Forecast',
description: 'Extended weather forecast',
mimeType: 'application/json',
},
],
}
})
// Handle resource reading
server.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:

Terminal window
# Install MCP Inspector
npm install -g @modelcontextprotocol/inspector
# Run the server with inspector
npx mcp-inspector node weather-server/src/index.ts

I get this output:

Terminal window
MCP Inspector running at http://localhost:5173
Server connected: weather-server v0.1.0
Available tools:
- get_weather

Best 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 development
const transport = new StdioServerTransport()
// For HTTP deployment
const transport = new SSEServerTransport('/message', res)

DON’T

Don’t skip input validation

// WRONG
const location = args.location // Could be undefined
// CORRECT
const location = args?.location
if (!location) {
throw new Error('location is required')
}

Don’t hardcode secrets

// WRONG
const apiKey = 'sk-proj-xxxxx'
// CORRECT
const apiKey = process.env.WEATHER_API_KEY

Don’t forget error handling

// WRONG
const data = await fetch(url)
return JSON.parse(data)
// CORRECT
try {
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

// WRONG
description: 'Tool' // Not helpful
// CORRECT
description: 'Get current weather for a location using city name or zip code'

Common Issues

Issue 1: Server Not Found

When I run:

Terminal window
npx mcp-inspector node weather-server/src/index.ts

I get this error:

Terminal window
Error: Cannot find module './index.ts'

The fix is to use the correct path:

Terminal window
npx mcp-inspector --node-arg=--loader ts-node/esm weather-server/src/index.ts

Issue 2: Tools Not Appearing

When tools don’t show up in Inspector, I check the ListTools handler:

// Missing return causes tools to not appear
server.setRequestHandler(ListToolsRequestSchema, async () => {
// I forgot to return the tools object
})
// Correct version
server.setRequestHandler(ListToolsRequestSchema, async () => {
return {
tools: [...] // Must return this
}
})

Issue 3: Type Errors

When I get TypeScript errors:

Terminal window
error TS2345: Argument of type 'string' is not assignable to parameter of type 'Tool'

I fix the type imports:

// Correct imports from SDK
import type { Tool } from '@modelcontextprotocol/sdk/types.js'
const tool: Tool = {
name: 'get_weather',
description: '...',
inputSchema: {...}
}

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:

Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!

Comments