This project implements a Model Context Protocol (MCP) server named 'test'. It provides a single tool, create-user, which allows for the creation of new user entries that are persisted in a JSON file.
The server is built using TypeScript and leverages the @modelcontextprotocol/sdk to establish an MCP server. It exposes a create-user tool with the following parameters: name, email, address, and phone. When this tool is invoked, it adds a new user object to the src/data/user.json file.
To set up the project, first install the required dependencies. Navigate to the project root directory and execute:
npm installThe project is written in TypeScript and needs to be compiled into JavaScript before it can be run.
To compile the project once:
npm run buildTo compile the project and automatically recompile upon file changes:
npm run build:watchTo run the compiled JavaScript server:
npm startFor development purposes, you can use nodemon to automatically restart the server when file changes are detected. This command first builds the project and then starts nodemon:
npm run devTo run the project with the Model Context Protocol Inspector, which can be useful for debugging and interacting with the MCP server:
npm run inspect