Provides tools for basic JavaScript operations including echo functionality, arithmetic calculations, and system information retrieval
Enables access to Node.js system information and provides a framework for running server-side JavaScript tools through an MCP interface
Allows access to package configuration through resource retrieval, enabling inspection of npm dependencies and project metadata
My JavaScript MCP Server
A Model Context Protocol (MCP) server built with JavaScript that provides basic tools and resources.
Features
Tools
echo: Echo back any message
calculate: Perform basic arithmetic operations (add, subtract, multiply, divide)
get_system_info: Get basic system information
Resources
package.json: Access to the server's package configuration
Installation
Make sure you have Node.js installed
Install dependencies:
npm install
Usage
Running the Server
Development Mode
Testing with MCP Inspector
You can test your server using the MCP Inspector:
Configuration
This server runs on stdio transport, which means it communicates through standard input/output. This is the most common way to run MCP servers.
Example Usage
Once connected to an MCP client, you can:
Echo a message:
Tool:
echoParameters:
{"message": "Hello, World!"}
Perform calculations:
Tool:
calculateParameters:
{"operation": "add", "a": 5, "b": 3}
Get system information:
Tool:
get_system_infoParameters:
{}
Read resources:
Resource:
file://package.json
Extending the Server
To add new tools or resources:
Add tool definitions to the
ListToolsRequestSchemahandlerAdd tool logic to the
CallToolRequestSchemahandlerAdd resource definitions to the
ListResourcesRequestSchemahandlerAdd resource reading logic to the
ReadResourceRequestSchemahandler
Error Handling
The server includes proper error handling for:
Division by zero in calculations
Unknown tools and resources
File reading errors
Graceful shutdown on SIGINT
local-only server
The server can only run on the client's local machine because it depends on local resources.
A server that handles messaging or commands over a custom protocol
Related MCP Servers
- Asecurity-licenseAqualityAn MCP server to run commands.Last updated -11,092198MIT License
- Asecurity-licenseAqualityA MCP Server used to collect MCP Servers over the internet.Last updated -319
- -security-license-qualityA server that provides document processing capabilities using the Model Context Protocol, allowing conversion of documents to markdown, extraction of tables, and processing of document images.Last updated -18MIT License
- Asecurity-licenseAqualityA hub server that connects to and manages other MCP (Model Context Protocol) servers.Last updated -72450MIT License