$120 tested Claude codes · real before/after data · Full tier $15 one-timebuy --sheet=15 →
$Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. download --free →
clskills.sh — terminal v2.4 — 2,347 skills indexed● online
[CL]Skills_
Claude CodeintermediateNew

MCP Server Setup

Share

Set up Model Context Protocol servers for Claude Code

Works with OpenClaude

You are an MCP (Model Context Protocol) server configuration expert. The user wants to set up and configure MCP servers to extend Claude Code's capabilities with custom tools and resources.

What to check first

  • Verify Node.js version is 16+ with node --version
  • Check if @modelcontextprotocol/sdk is available in your project or install it with npm install @modelcontextprotocol/sdk
  • Confirm Claude Code supports MCP by checking the .mcp-server.json configuration file location in your workspace root

Steps

  1. Create .mcp-server.json in your project root to define server configurations
  2. Install the MCP SDK package: npm install @modelcontextprotocol/sdk (if not present)
  3. Build your MCP server file (e.g., mcp-server.js or mcp-server.ts) with Tool and Resource handlers
  4. Define tools array with name, description, and inputSchema for each tool you expose
  5. Define resources array with URI patterns and content handlers if sharing files/data
  6. Add server entry to .mcp-server.json with command to start your server process
  7. Test the server locally with node mcp-server.js and verify it starts without errors
  8. Reload Claude Code or run the MCP server discovery to register tools and resources

Code

// mcp-server.js - Basic MCP Server Setup
const { Server } = require('@modelcontextprotocol/sdk/server');
const { StdioServerTransport } = require('@modelcontextprotocol/sdk/server/stdio');

const server = new Server({
  name: 'my-custom-server',
  version: '1.0.0',
});

// Define tools that Claude Code can call
server.setRequestHandler('tools/list', async () => {
  return {
    tools: [
      {
        name: 'calculate_sum',
        description: 'Adds two numbers together',
        inputSchema: {
          type: 'object',
          properties: {
            a: { type: 'number', description: 'First number' },
            b: { type: 'number', description: 'Second number' },
          },
          required: ['a', 'b'],
        },
      },
      {
        name: 'fetch_weather',
        description: 'Fetches current weather for a location',
        inputSchema: {
          type: 'object',
          properties: {
            location: { type: 'string', description: 'City name' },
          },
          required: ['location'],
        },
      },
    ],
  };
});

// Implement tool execution handlers
server.setRequestHandler('tools/call', async (request) => {
  const { name, arguments: args } = request.params;

  if (name === 'calculate_sum') {
    return {
      content: [

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

CategoryClaude Code
Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
claude-codemcpserver

Install command:

curl -o ~/.claude/skills/mcp-server-setup.md https://claude-skills-hub.vercel.app/skills/claude-code/mcp-server-setup.md

Related Claude Code Skills

Other Claude Code skills in the same category — free to download.

Want a Claude Code skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.