MCP Servers
March 30, 2025 ยท View on GitHub
I created this repository to test and hands-on with different MCP servers.
The repository provides implementations for creating and managing different MCP (Model Context Protocol) servers. MCP is designed to facilitate communication between AI models and applications by maintaining structured contextual exchanges.
Features
- Lightweight and modular MCP server implementations.
- Supports multiple transport protocols (HTTP, WebSockets, gRPC, etc.).
- Configurable context management and model routing.
Setup Instructions
Follow these steps sequentially to configure and run the MCP server:
1. Install Dependencies
Navigate to your project directory and install the required dependencies:
npm install # Download dependencies
2. Configure TypeScript and Build Scripts
Update your package.json file to include the following settings:
{
"type": "module",
"bin": {
"weather": "./build/index.js"
},
"scripts": {
"build": "tsc && chmod 755 build/index.js"
},
"files": [
"build"
]
}
Create a tsconfig.json file with the following configuration:
{
"compilerOptions": {
"target": "ES2022",
"module": "Node16",
"moduleResolution": "Node16",
"outDir": "./build",
"rootDir": "./src",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}
3. Modify Claude Desktop Configuration
If you are using Claude Desktop, ensure the MCP server is registered correctly.
Open the configuration file using the following command:
vim ~/Library/Application\ Support/Claude/claude_desktop_config.json
If the file does not exist, create it and add the following configuration:
{
"mcpServers": {
"weather": {
"command": "node",
"args": [
"/path/to/your/build/index.js"
]
}
}
}
Replace "/path/to/your/build/index.js" with the actual path to your built MCP server script.
4. Build and Run the MCP Server
Compile the TypeScript files:
npm run build # Compile TypeScript files
Start the MCP server:
node build/index.js