@eloquentops/sum-mcp
v1.0.1
Published
A simple MCP server that makes API calls to external services
Readme
Sum MCP Server
A simple Model Context Protocol (MCP) server that demonstrates making fetch requests to external APIs.
Features
This MCP server provides two tools:
- calculate-sum: Calculates the sum of two numbers and fetches data from an external API
- fetch-random-data: Fetches random user data from an external API service
Installation
npm install
npm run buildUsage
As a local MCP server
You can run the server locally:
npm startAs an npm package (for deployment)
To use this MCP server in your MCP client configuration, you can publish it to npm or use it locally:
{
"mcpServers": {
"sum-mcp": {
"command": "npx",
"args": ["-y", "@eloquentops/sum-mcp"]
}
}
}Local development/testing
For local testing, you can reference the built file directly:
{
"mcpServers": {
"sum-mcp": {
"command": "node",
"args": ["/path/to/sum/build/index.js"]
}
}
}Tools Available
calculate-sum
- Description: Calculates the sum of two numbers by making a request to a math API service
- Parameters:
a(number): First number to addb(number): Second number to add
- Example:
calculate-sumwitha: 5, b: 3will return8plus API data
fetch-random-data
- Description: Fetches random data from an external API service
- Parameters: None
- Example: Returns random user information from JSONPlaceholder API
Development
The server is built with TypeScript and uses:
@modelcontextprotocol/sdkfor MCP server functionalityzodfor input validation- Native
fetchAPI for HTTP requests
API Services Used
This server makes requests to:
- JSONPlaceholder API (https://jsonplaceholder.typicode.com/) for demonstration purposes
- You can modify the URLs in the source code to use different APIs
