home / mcp / litemcp mcp server

LiteMCP MCP Server

A TypeScript MCP server framework with tools, resources, prompts, logging, and built‑in testing utilities.

Installation
Add the following to your MCP client configuration file.

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.

How to use

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.

How to install

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 zod

Running and testing your server

You 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.js

Transport and advanced running

LiteMCP 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.

Testing and debugging tips

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.

Available tools

add

Add a simple numeric tool that combines two inputs to produce a result (example of exposing executable actions)

fetch

Fetch the content from a URL as a tool that can be invoked by clients and LLMs

download

Download a file from a URL and return the result to the client