geekconvert/my-mcp-server
If you are the rightful owner of my-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
This document provides a comprehensive overview of a Model Context Protocol (MCP) server setup for integration with Visual Studio Code (VSCode) using stdin/stdout communication.
MCP City State Resolver Server
A Model Context Protocol (MCP) server that provides state information for Indian cities using StreamableHTTP transport.
Features
- 🌍 City to State Mapping: Get state names for Indian cities
- 🚀 HTTP Transport: Uses StreamableHTTP for communication
- 🧪 Comprehensive Testing: Includes automated test suite
- 📋 Management Scripts: Easy server management
Supported Cities
The server currently supports the following cities:
- Kanpur → Uttar Pradesh
- Delhi → Delhi
- Mumbai → Maharashtra
- Bangalore → Karnataka
- Chennai → Tamil Nadu
- Kolkata → West Bengal
- Hyderabad → Telangana
- Pune → Maharashtra
- Jaipur → Rajasthan
- Lucknow → Uttar Pradesh
Files Structure
├── simple-mcp-server.mjs # Main MCP server implementation
├── server.mjs # Alternative StreamableHTTP implementation
├── test-mcp.mjs # Test suite for the MCP server
├── manage-server.sh # Server management script
├── package.json # Node.js dependencies
└── .vscode/mcp.json # VS Code MCP configuration
Installation
- Install dependencies:
npm install
- Start the server:
./manage-server.sh start
Usage
Using the Management Script
# Start the server
./manage-server.sh start
# Check server status
./manage-server.sh status
# Test the server
./manage-server.sh test
# View logs
./manage-server.sh logs
# Stop the server
./manage-server.sh stop
# Restart the server
./manage-server.sh restart
Manual Testing
The server runs on http://localhost:3001/mcp and follows the MCP protocol.
Tool Details
getStateByCityName
Description: Get the state name for a given city in India
Parameters:
city(string, required): The name of the city
Response:
{
"city": "Kanpur",
"state": "Uttar Pradesh",
"found": true
}
VS Code Integration
The server is configured for VS Code MCP integration in .vscode/mcp.json:
{
"servers": {
"statename": {
"type": "http",
"url": "http://localhost:3001/mcp"
}
}
}
Testing Results
✅ Server Initialization: Successfully initializes with MCP protocol
✅ Tool Discovery: Lists available tools correctly
✅ City Lookup: Returns correct state for known cities
✅ Unknown Cities: Handles unknown cities gracefully
✅ Error Handling: Proper error responses for invalid requests
above is the json to connect this mcp server with vscode using stdin/stdout.