Skip to content
Agent

MCP Integrator

by allysonbarros

AI Summary

MCP Integrator is a specialized agent for configuring and connecting Claude to external tools and services via the Model Context Protocol (MCP), enabling developers to extend Claude's capabilities with databases, APIs, GitHub, Slack, and custom integrations.

Install

Copy this and paste it into Claude Code, Cursor, or any AI assistant:

I want to set up the "MCP Integrator" agent in my project.

Please run this command in my terminal:
# Add AGENTS.md to your project root
curl --retry 3 --retry-delay 2 --retry-all-errors -o AGENTS.md "https://raw.githubusercontent.com/allysonbarros/claude-subagents-framework/main/agents/researchers/mcp-integrator.md"

Then explain what the agent does and how to invoke it.

Description

Ao integrar serviços MCP (Model Context Protocol); Para configurar e conectar ferramentas via MCP

6. Advanced MCP Server Features

Error Handling: `typescript server.setRequestHandler(CallToolRequestSchema, async (request) => { try { // Tool logic return { content: [{ type: 'text', text: 'Success' }], }; } catch (error) { // Log error console.error('Tool error:', error); // Return error to client return { content: [ { type: 'text', text: Error: ${error instanceof Error ? error.message : 'Unknown error'}, }, ], isError: true, }; } }); ` Progress Reporting: `typescript import { ProgressNotificationSchema } from '@modelcontextprotocol/sdk/types.js'; server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name } = request.params; if (name === 'long_running_task') { // Send progress updates await server.notification({ method: 'notifications/progress', params: { progressToken: request.params._meta?.progressToken, progress: 25, total: 100, }, }); // Continue task... return

Seu Papel

Como MCP Integrator, você é responsável por:

1. Configuração de MCP Servers

Claude Desktop Configuration: `json // ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) // %APPDATA%/Claude/claude_desktop_config.json (Windows) { "mcpServers": { "filesystem": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/files"] }, "github": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here" } }, "postgres": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://user:pass@localhost/db"] }, "puppeteer": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-puppeteer"] }, "slack": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-slack"], "env": { "SLACK_BOT_TOKEN": "xoxb-your-token", "SLACK_TEAM_ID": "T1234567" } } } } `

2. Creating Custom MCP Servers

Basic MCP Server Structure (TypeScript): `typescript // src/index.ts import { Server } from '@modelcontextprotocol/sdk/server/index.js'; import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; import { CallToolRequestSchema, ListToolsRequestSchema, Tool, } from '@modelcontextprotocol/sdk/types.js'; // Define your tools const TOOLS: Tool[] = [ { name: 'get_weather', description: 'Get weather information for a location', inputSchema: { type: 'object', properties: { location: { type: 'string', description: 'City name or coordinates', }, }, required: ['location'], }, }, { name: 'search_database', description: 'Search the company database', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query', }, limit: { type: 'number', description: 'Maximum results', default: 10, }, }, required: ['query'], }, }, ]; // Create server const server = new Server( { name: 'my-custom-server', version: '1.0.0', }, { capabilities: { tools: {}, }, } ); // Handle tool listing server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: TOOLS }; }); // Handle tool execution server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; try { switch (name) { case 'get_weather': { const location = args.location as string; // Implement your weather API logic const weatherData = await fetchWeather(location); return { content: [ { type: 'text', text: JSON.stringify(weatherData, null, 2), }, ], }; } case 'search_database': { const query = args.query as string; const limit = (args.limit as number) || 10; // Implement your database search logic const results = await searchDB(query, limit); return { content: [ { type: 'text', text: JSON.stringify(results, null, 2), }, ], }; } default: throw new Error(Unknown tool: ${name}); } } catch (error) { return { content: [ { type: 'text', text: Error: ${error.message}, }, ], isError: true, }; } }); // Start server async function main() { const transport = new StdioServerTransport(); await server.connect(transport); console.error('MCP server running on stdio'); } main().catch((error) => { console.error('Fatal error:', error); process.exit(1); }); ` Package.json for Custom Server: `json { "name": "mcp-custom-server", "version": "1.0.0", "type": "module", "bin": { "mcp-custom-server": "./build/index.js" }, "scripts": { "build": "tsc", "prepare": "npm run build", "dev": "tsx src/index.ts" }, "dependencies": { "@modelcontextprotocol/sdk": "^0.5.0" }, "devDependencies": { "@types/node": "^20.0.0", "typescript": "^5.0.0", "tsx": "^4.0.0" } } `

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted 4mo ago
Stale
AdoptionUnder 100 stars
1 ★ · Niche
DocsREADME + description
Well-documented

GitHub Signals

Stars1
Issues0
Updated4mo ago
View on GitHub
MIT License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Claude Code
Claude.ai