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 henry@mcphub.com.
A demonstration project showcasing how to implement a Model Context Protocol (MCP) server that exposes MongoDB payment data through both MCP Inspector and Claude AI integration.
NextApp Payments MCP Server Demo
A demonstration project showcasing how to implement a Model Context Protocol (MCP) server that exposes MongoDB payment data through both MCP Inspector and Claude AI integration. This project serves as an example of how to use the MCP protocol to expose database resources through a standardized interface.
📝 For a detailed, step-by-step guide on building this MCP server from scratch, check out my comprehensive blog post.
Project Overview
This demo project demonstrates:
- Implementation of an MCP server using the official SDK
- Connection to a specific MongoDB Atlas database
- Exposure of payment data through both MCP Resources and Tools
- Integration with both MCP Inspector and Claude AI
- How LLMs can interact with structured database data
Features
MCP Resources
- URI:
payments://done
- Purpose: Retrieves payment records where
done: true
- Response Format: JSON
- MIME Type:
application/json
MCP Tools
-
get_completed_payments
- Description: Retrieves all payments where done is true
- Input: No parameters required
- Output: JSON array of completed payments
-
get_all_payments
- Description: Retrieves all payments from the database
- Input: No parameters required
- Output: JSON array of all payments
MCP Inspector View
The image above shows the MCP Inspector interface displaying the payment records retrieved from MongoDB Atlas through the MCP server. MCP Inspector is a developer tool that helps verify and debug MCP server implementations.
Claude AI Integration
The image above demonstrates Claude AI successfully:
- Connecting to the MCP server
- Accessing the payments resource and tools
- Analyzing payment data
- Presenting structured results with total amounts, date ranges, and key observations
Setting Up Your MCP Resource in Claude Desktop
If you have created your own MCP server and want to use it with Claude Desktop:
-
Locate Claude Desktop Config
- Windows:
C:\Users\<username>\AppData\Roaming\claude\claude_desktop_config.json
- macOS:
~/Library/Application Support/claude/claude_desktop_config.json
- Linux:
~/.config/claude/claude_desktop_config.json
- Windows:
-
Configure Your MCP Server
{ "mcpServers": { "YourServerName": { "transport": "stdio", "command": "node", "args": ["path/to/your/server.js"], "env": { "YOUR_ENV_VARIABLE": "your_value" }, "cwd": "path/to/your/project" } } }
Replace:
YourServerName
: A unique name for your serverpath/to/your/server.js
: Full path to your server fileYOUR_ENV_VARIABLE
: Any environment variables your server needs
-
Verify Connection
- Open Claude Desktop
- Go to Settings → Developer
- Your server should appear with a "running" status
-
Use Your Resource or Tools
# Using Resource Use the MCP resource payments://done and [your query] # Using Tools Use the MCP tool get_completed_payments to show me all successful payments Use the MCP tool get_all_payments to show me all payments in the system
Implementation Details
Technologies Used
- MCP SDK: For protocol handling and resource/tool exposure
- MongoDB Driver: For database access and query execution
- Claude Desktop: For LLM integration and natural language querying
Error Handling
The implementation includes error handling for:
- MongoDB connection issues
- Query execution errors
- Connection closure errors
- JSON-formatted logging for Claude Desktop compatibility
Important Notes
This is a demonstration project showing:
- How to implement an MCP server
- How to expose MongoDB data as both MCP resources and tools
- Multiple ways to access the data:
- Through MCP Inspector (for developers)
- Through Claude AI (for end users)
- Through direct tool calls
- How LLMs can interact with structured data
The MongoDB connection and resource configurations are specific to this demo. You'll need to modify them for your use case.