peterbud/nitro-mcp-server
If you are the rightful owner of nitro-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.
The Nitro MCP Server is a lightweight and fast server implementation using the Model Context Protocol (MCP) with streamable HTTP transport, powered by Nitro.
echo
Echoes back the input, demonstrating basic tool functionality
getPostsByUser
Fetches posts by a user using an API, demonstrating output schema validation and structuredContent
Nitro MCP Server
This project is an MCP (Model Context Protocol) server using streamable HTTP transport powered by the Nitro. It is designed to demonstrate how to implement an MCP Server. Please note currently there is no authentication implemented, so this is not suitable for production use.
Features
- Lightweight and fast, built on Nitro
- Tools located at
/tools
- Input and output schema validation with Zod
- Example tools included:
echo
: Echoes back the input, demonstrating basic tool functionalitygetPostsByUser
: Fetches posts by a user using an API, demonstrating output schema validation andstructuredContent
- Example resources included:
posts
: Fetches posts from an API, demonstrating resource handlingusers
: Fetches users from an API, demonstrating resource handling
- Easy integration with MCP clients
Getting Started
Prerequisites
- Node.js (v20 or higher recommended)
- pnpm (see pnpm installation guide)
Installation
- Clone the repository:
git clone https://github.com/yourusername/nitro-mcp-server.git cd nitro-mcp-server
- Install dependencies:
pnpm install
Running the Server
Start the server with:
pnpm dev
Running the MCP inspector:
pnpm inspect
- Open your browser and navigate to the inspector URL like
http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=<token>
to access the MCP inspector. - Enter the address and port of your server at the URL field, like
http://localhost:3000/mcp
. - Click "Connect" to establish a connection to your MCP Server.
- You can list the tools and invoke them.
Building the server
To build the server for production, run:
pnpm build
This will create a production-ready build in the .output
directory.
Configuration
Configuration options can be set in the .env
file. Options include:
NITRO_MCP_SERVER_HOST
: The host the server listens on (default:localhost
)NITRO_MCP_SERVER_PORT
: The port the server listens on (default: 3000)
Todo
- Add authentication support
Contributing
Pull requests and issues are welcome! Please open an issue to discuss your ideas or report bugs.
License
This project is licensed under the MIT License. See the file for details.