Skip to main content
Glama
saksham0712

MCP Complete Implementation Guide

by saksham0712

Model Context Protocol (MCP) - Complete Implementation Guide

πŸš€ Overview

Model Context Protocol (MCP) is an open standard that enables seamless integration between AI applications and external data sources and tools. This guide provides a complete end-to-end implementation with all necessary configuration files and integration examples for ChatGPT, Claude, and other AI models.

Related MCP server: MCP Server

πŸ“‹ Table of Contents

πŸ€” What is MCP?

MCP (Model Context Protocol) is a standardized way to:

  • Connect AI models to external data sources

  • Provide tools and functions that AI models can use

  • Enable secure and controlled access to resources

  • Create reusable components across different AI applications

Key Components:

  • MCP Server: Provides tools, resources, and prompts

  • MCP Client: AI applications that consume MCP services

  • Transport Layer: Communication protocol (stdio, HTTP, WebSocket)

✨ Benefits

  • Standardized Integration: Universal protocol for AI model connections

  • Security: Controlled access to external resources

  • Reusability: One MCP server can serve multiple AI applications

  • Extensibility: Easy to add new tools and resources

  • Local Development: Run everything locally for privacy and control

πŸ”§ Prerequisites

Required Software:

  • Node.js (v18 or later) or Python (3.8+)

  • Git

  • PowerShell (Windows)

  • VS Code (recommended)

For AI Model Integration:

  • API keys for your chosen AI models

  • Claude Desktop, ChatGPT Desktop, or compatible client

πŸš€ Quick Start

1. Clone and Setup

# Create project directory
mkdir mcp-implementation
cd mcp-implementation

# Initialize the project
git init
npm init -y  # or use Python if preferred

2. Install Dependencies

# For Node.js implementation
npm install @modelcontextprotocol/sdk express cors dotenv

# For Python implementation (alternative)
pip install mcp python-dotenv fastapi uvicorn

3. Run the Example Server

# Start the MCP server
node server.js

# Or for Python
python server.py

4. Configure Your AI Client

Update your AI client configuration (examples provided below for each platform).

πŸ› οΈ Server Implementation

Node.js MCP Server

Our MCP server will provide:

  • File system tools

  • Web scraping capabilities

  • System information

  • Custom business logic

See server.js for the complete implementation.

Python MCP Server (Alternative)

For Python developers, we also provide a Python implementation in server.py.

πŸ€– AI Model Integration

Claude Desktop Integration

Claude Desktop has native MCP support. Configuration is done through claude_desktop_config.json.

ChatGPT Integration

Integration through custom plugins or API wrapper. See chatgpt-integration/ directory.

Other AI Models

Generic HTTP client implementation for any AI model that supports external tool calling.

βš™οΈ Configuration Files

This repository includes configuration files for:

  • claude_desktop_config.json - Claude Desktop MCP configuration

  • chatgpt-config.json - ChatGPT plugin configuration

  • mcp-config.json - Generic MCP server configuration

  • .env - Environment variables and API keys

  • package.json - Node.js dependencies and scripts

🏠 Local Development

Development Scripts

We provide PowerShell scripts for easy development:

  • scripts/setup.ps1 - Initial setup and dependency installation

  • scripts/start-dev.ps1 - Start development server with hot reload

  • scripts/test.ps1 - Run tests and validation

Environment Setup

  1. Copy .env.example to .env

  2. Fill in your API keys and configuration

  3. Run the setup script

.\scripts\setup.ps1

πŸš€ Deployment

Local Deployment

# Production build
npm run build

# Start production server
npm start

Docker Deployment

# Build Docker image
docker build -t mcp-server .

# Run container
docker run -p 3000:3000 --env-file .env mcp-server

Cloud Deployment

Instructions for deploying to:

  • Heroku

  • AWS Lambda

  • Google Cloud Functions

  • Azure Functions

πŸ”§ Troubleshooting

Common Issues

  1. Connection Refused: Check if MCP server is running

  2. Authentication Errors: Verify API keys in .env

  3. Tool Not Found: Ensure tools are properly registered

  4. CORS Issues: Check CORS configuration in server

Debugging

# Enable debug logging
$env:DEBUG = "mcp:*"
node server.js

Health Check

# Test server health
curl http://localhost:3000/health

πŸš€ Advanced Features

Custom Tools

Learn how to create custom tools for your specific use case.

Resource Management

Implement resource caching and management for better performance.

Security

Best practices for securing your MCP server and API keys.

Monitoring

Set up logging and monitoring for production deployments.

πŸ“ Project Structure

mcp-implementation/
β”œβ”€β”€ README.md                 # This file
β”œβ”€β”€ server.js                # Main MCP server (Node.js)
β”œβ”€β”€ server.py                # Alternative Python server
β”œβ”€β”€ package.json             # Node.js dependencies
β”œβ”€β”€ requirements.txt         # Python dependencies
β”œβ”€β”€ .env.example             # Environment variables template
β”œβ”€β”€ claude_desktop_config.json # Claude Desktop configuration
β”œβ”€β”€ chatgpt-config.json      # ChatGPT integration config
β”œβ”€β”€ mcp-config.json          # Generic MCP configuration
β”œβ”€β”€ Dockerfile               # Docker container configuration
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ setup.ps1           # Setup script for Windows
β”‚   β”œβ”€β”€ start-dev.ps1       # Development server script
β”‚   └── test.ps1            # Testing script
β”œβ”€β”€ examples/
β”‚   β”œβ”€β”€ claude-integration/  # Claude-specific examples
β”‚   β”œβ”€β”€ chatgpt-integration/ # ChatGPT integration examples
β”‚   └── generic-client/      # Generic client examples
β”œβ”€β”€ tools/
β”‚   β”œβ”€β”€ filesystem.js       # File system tools
β”‚   β”œβ”€β”€ web-scraper.js      # Web scraping tools
β”‚   └── system-info.js      # System information tools
└── tests/
    β”œβ”€β”€ server.test.js      # Server tests
    └── integration.test.js # Integration tests

πŸ“š Next Steps

  1. Follow the Quick Start guide

  2. Explore the example implementations

  3. Configure your preferred AI model

  4. Customize tools for your use case

  5. Deploy to your preferred platform

🀝 Contributing

Contributions are welcome! Please read our contributing guidelines and submit pull requests for any improvements.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

If you encounter any issues:

  1. Check the Troubleshooting section

  2. Search existing GitHub issues

  3. Create a new issue with detailed information


Happy coding with MCP! πŸš€

Available Tools

6 tools
execute_commandB

Execute a system command (use with caution)

ParametersJSON Schema
NameRequiredDescriptionDefault
commandYesThe command to execute
cwdNoWorking directory for the command

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It hints at caution but doesn't specify what risks are involved (e.g., destructive effects, permission requirements, or rate limits). This leaves significant gaps in understanding the tool's behavior beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with just one sentence, front-loaded with the core action and a cautionary note. Every word earns its place, making it efficient and easy to parse without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (executing system commands can be high-risk), lack of annotations, and no output schema, the description is incomplete. It doesn't cover return values, error handling, security implications, or detailed behavioral traits, leaving the agent with insufficient context for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, clearly documenting the 'command' and 'cwd' parameters. The description adds no additional parameter details beyond what the schema provides, so it meets the baseline of 3 for high schema coverage without compensating with extra semantic value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('execute') and resource ('system command'), making the purpose understandable. However, it doesn't differentiate from siblings like 'get_system_info' or 'list_directory' which might also involve system operations, leaving some ambiguity about when to choose this specific tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'use with caution' implies this tool should be used carefully, suggesting it might have risks or side effects. However, it doesn't provide explicit guidance on when to use it versus alternatives like 'get_system_info' for safe queries, nor does it specify prerequisites or exclusions, leaving usage context somewhat vague.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

fetch_urlC

Fetch content from a URL

ParametersJSON Schema
NameRequiredDescriptionDefault
headersNoHTTP headers to include
methodNoHTTP method (GET, POST, etc.)GET
urlYesThe URL to fetch

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states the basic action without disclosing behavioral traits. It doesn't mention error handling, timeouts, authentication needs, rate limits, or what 'content' includes (e.g., HTML, JSON, binary data). This leaves significant gaps for an agent to understand how to use it effectively.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with zero wasteβ€”it directly states the tool's function without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of HTTP operations and lack of annotations or output schema, the description is incomplete. It doesn't explain return values (e.g., status codes, body content), error cases, or behavioral nuances like redirects or timeouts, which are critical for proper tool usage in this context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters (url, method, headers) thoroughly. The description adds no additional meaning beyond implying URL fetching, which is redundant with the schema. This meets the baseline of 3 when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Fetch content from a URL' clearly states the verb ('fetch') and resource ('content from a URL'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'read_file' or 'execute_command' which might also retrieve data, so it's not fully distinctive.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention scenarios like web scraping, API calls, or file downloads, nor does it contrast with siblings like 'read_file' for local files or 'execute_command' for system-level operations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_system_infoC

Get system information

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

C2.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It implies a read-only operation ('get'), but does not specify whether it requires permissions, what data it returns, if there are rate limits, or any side effects. This is inadequate for a tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with a single three-word phrase, 'Get system information', which is front-loaded and wastes no words. It efficiently communicates the core purpose without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It does not explain what information is returned, the format, or any behavioral traits, making it insufficient for an agent to understand the tool's full context and usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description does not add parameter details, which is appropriate, and it correctly implies no inputs are required, earning a baseline score of 4 for tools with zero parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get system information' restates the tool name 'get_system_info' with minimal elaboration, making it tautological. It specifies the verb 'get' and resource 'system information', but lacks detail on what type of system information (e.g., hardware specs, OS details, performance metrics) or scope, failing to distinguish it from potential alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus sibling tools like 'execute_command' or 'fetch_url'. It does not mention any context, prerequisites, or exclusions, leaving the agent with no information to make an informed choice among available tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_directoryC

List the contents of a directory

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesThe path to the directory to list

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It implies a read-only operation ('List') but doesn't disclose critical traits like error handling (e.g., if path doesn't exist), output format (e.g., list structure, metadata included), or performance considerations (e.g., large directories). This is inadequate for a tool with no annotation support.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place by directly contributing to understanding the tool's purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a simple input schema, the description is incomplete. It lacks details on behavioral aspects (e.g., what 'contents' means, error cases) and usage context, which are essential for an agent to invoke this tool correctly in real scenarios. The simplicity of the tool doesn't excuse these gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents the 'path' parameter fully. The description adds no additional meaning beyond implying the parameter is for directory listing, which the schema's description ('The path to the directory to list') already covers. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('contents of a directory'), making the purpose immediately understandable. It distinguishes from siblings like 'read_file' (which reads file contents) and 'execute_command' (which runs commands). However, it doesn't specify what 'contents' includes (files, subdirectories, metadata), which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., directory existence, permissions), exclusions (e.g., not for file reading), or comparisons to siblings like 'get_system_info' (which might provide system-level directory info). This leaves the agent with minimal context for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

read_fileC

Read the contents of a file

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesThe path to the file to read

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states the basic action without disclosing behavioral traits. It doesn't mention permissions required, whether it's safe (read-only), potential errors (e.g., file not found), or output format (text, binary). This is inadequate for a tool with mutation siblings.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words, front-loading the core action. It earns its place by being maximally concise while still conveying the essential purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and siblings that include mutations ('write_file'), the description is incomplete. It doesn't address safety (read-only vs. destructive), return values, or error handling, leaving significant gaps for agent understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents the 'path' parameter fully. The description adds no additional meaning about parameter usage (e.g., path formats, relative vs. absolute), meeting the baseline but not compensating beyond what's structured.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('read') and resource ('contents of a file'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'list_directory' or 'fetch_url' which also involve file operations, so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'list_directory' (for browsing) or 'write_file' (for modification). There's no mention of prerequisites, file types supported, or error conditions, leaving the agent with insufficient context for optimal selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

write_fileC

Write content to a file

ParametersJSON Schema
NameRequiredDescriptionDefault
contentYesThe content to write to the file
pathYesThe path to the file to write

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. 'Write content to a file' implies a destructive mutation but doesn't specify whether this overwrites existing files, creates new ones, or appends. It doesn't mention error conditions, file system permissions needed, or what happens on success/failure. This leaves significant behavioral gaps for a file system mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is maximally concise at just four words. Every word earns its place: 'Write' specifies the action, 'content' and 'file' specify what's being manipulated, and 'to' provides necessary grammatical structure. There's zero waste or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a file system mutation tool with no annotations and no output schema, the description is incomplete. It doesn't address critical context like whether the operation overwrites or appends, what permissions are required, what happens if the path doesn't exist, or what the tool returns. The agent lacks sufficient information to use this tool safely and effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters ('content' and 'path') adequately. The description adds no additional parameter semantics beyond what's in the schema. It doesn't clarify path format requirements, content encoding, or file type implications. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('write') and target resource ('content to a file'), making the purpose immediately understandable. It distinguishes itself from sibling tools like 'read_file' by specifying the opposite operation. However, it doesn't specify what type of writing occurs (overwrite, append, etc.), keeping it from a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites like file permissions, when to use 'execute_command' for file operations instead, or how it relates to 'read_file' for file manipulation workflows. The agent must infer usage context entirely from the tool name and parameters.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 6 tool updatesv1.0.0
    • First observedexecute_command
    • First observedfetch_url
    • First observedget_system_info
    • First observedlist_directory
    • First observedread_file
    • First observedwrite_file

TDQS

B3.3/5.0

Scored across 6 tools

Disambiguation5/5

Each tool has a clearly distinct purpose with no overlap: execute_command runs system commands, fetch_url retrieves web content, get_system_info provides system metadata, list_directory shows directory contents, read_file reads file data, and write_file writes file data. The descriptions make it impossible to confuse one tool for another.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern (e.g., execute_command, fetch_url, read_file) using snake_case throughout. There are no deviations in naming style or convention across the entire set.

Tool Count5/5

With 6 tools, this is well-scoped for a system utility server. Each tool earns its place by covering distinct, fundamental operations like file I/O, system commands, and network requests, without being overly sparse or bloated.

Completeness4/5

The toolset covers core system and file operations comprehensively, including read/write, directory listing, command execution, and URL fetching. A minor gap exists in lacking update/delete file operations, but agents can work around this using existing tools like write_file for overwrites.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    B
    maintenance
    Zero-dependency MCP server that provides AI models with secure read/write/exec access to local files and directories over HTTP and SSE, designed to be tunneled via ngrok for integration with Claude Web.
    -