docs

Plug-and-Play Documentation

docs.sh — Copy-paste snippets
[ _ ][ 🗗 ][ X ]

Your GitHub repository is your most important DevRel blog. Tested configs, copy-paste ready.

--tool@@modelcontextprotocol/sdk

Official MCP SDK (v1.25.3 Feb 2026) — build Claude-compatible servers in TypeScript/Python. Powers 217+ community servers.

install
npm install @modelcontextprotocol/sdk
typescript
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';

const server = new Server({ name: 'example', version: '1.0.0' }, { capabilities: { tools: {} } });

server.setRequestHandler('tools/list', async () => ({
  tools: [{ name: 'get_weather', description: 'Get weather for city',
    inputSchema: { type: 'object', properties: { city: { type: 'string' } }, required: ['city'] } }]
}));

server.setRequestHandler('tools/call', async (req) => {
  if (req.params.name === 'get_weather') {
    return { content: [{ type: 'text', text: `Weather in ${req.params.arguments.city}: 72°F` }] };
  }
});

await server.connect(new StdioServerTransport());