home / mcp / litemcp mcp server
A TypeScript MCP server framework with tools, resources, prompts, logging, and built‑in testing utilities.
Configuration
View docs{
"mcpServers": {
"wong2-litemcp": {
"command": "npx",
"args": [
"litemcp",
"dev",
"server.js"
]
}
}
}LiteMCP is a TypeScript framework for building MCP servers. It lets you define tools, resources, and prompts with full TypeScript support, includes built-in logging and error handling, and provides a lightweight way to test and debug MCP servers from the terminal.
You build an MCP server by creating a LiteMCP instance, then register tools, resources, and prompts that clients can invoke or surface to language models. Start the server locally and test interactions using the built‑in CLI. You can also run in SSE mode for streaming scenarios and inspect the running server with a dedicated inspector.
Prerequisites: Node.js and npm must be installed on your machine.
# Initialize a new project (if needed)
npm init -y
# Install LiteMCP and its schema validator
npm install litemcp zodYou run your server locally using the command runner provided by the package. A common workflow is to start the server with a script file, then test and inspect using the built‑in tooling.
npx litemcp dev server.js
```
To inspect the server using the MCP Inspector Web UI, run:
```
npx litemcp inspect server.jsLiteMCP servers run by default over stdio transport. You can enable SSE transport to accept Server-Sent Events connections by starting the server with explicit transport configuration.
server.start({
transportType: "sse",
sse: {
endpoint: "/sse",
port: 8080,
},
});
```
This starts the server and listens for SSE connections at http://localhost:8080/sse.Use the built‑in CLI commands to rapidly test and debug your MCP server during development. The quickstart example shows how to define tools, resources, and prompts, then start and test the server in a local environment.
Add a simple numeric tool that combines two inputs to produce a result (example of exposing executable actions)
Fetch the content from a URL as a tool that can be invoked by clients and LLMs
Download a file from a URL and return the result to the client