Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/mcp-use/mcp-use/llms.txt

Use this file to discover all available pages before exploring further.

Quick Start Guide

This guide will help you create your first MCP server with mcp-use in both TypeScript and Python.

TypeScript Quickstart

Prerequisites

  • Node.js 20.19.0 or higher
  • npm, yarn, or pnpm

Create Your First Server

The fastest way to get started is using the project scaffolding tool:
npx create-mcp-use-app my-server
cd my-server
npm install
npm run dev
The development server includes hot reload and auto-opens the inspector at http://localhost:3000/inspector

Manual Setup

If you prefer to set up manually:
1

Install Dependencies

npm install mcp-use zod
2

Create Your Server

Create a file server.ts:
import { MCPServer, text } from "mcp-use/server";
import { z } from "zod";

const server = new MCPServer({
  name: "my-server",
  version: "1.0.0",
});

server.tool({
  name: "get_weather",
  description: "Get weather for a city",
  schema: z.object({ city: z.string() }),
}, async ({ city }) => {
  return text(`Temperature: 72°F, Condition: sunny, City: ${city}`);
});

await server.listen(3000);
// Inspector at http://localhost:3000/inspector
3

Run Your Server

npx tsx server.ts
Your server is now running!
  • MCP endpoint: http://localhost:3000/mcp
  • Inspector UI: http://localhost:3000/inspector

Test Your Server

Open the inspector at http://localhost:3000/inspector and try calling your tool:
{
  "city": "San Francisco"
}
The inspector provides a web interface to test all your tools, resources, and prompts without writing any client code.

Add More Features

// Add a resource that provides static data
server.resource({
  name: "config",
  uri: "app://config",
  title: "Application Config",
}, async () => {
  return text(JSON.stringify({
    version: "1.0.0",
    features: ["weather", "search"]
  }));
});

Next Steps

Build Your First Server

Learn to build a complete MCP server with tools, resources, and prompts

Create MCP Apps

Build interactive widgets for ChatGPT and Claude

Connect to Servers

Learn different ways to connect to MCP servers

Build AI Agents

Create intelligent agents that use MCP tools

Common Issues

If port 3000 (TypeScript) or 8000 (Python) is already in use, specify a different port:
await server.listen(3001);
server.run(transport="streamable-http", port=8001)
Make sure you’ve installed all dependencies:TypeScript:
npm install mcp-use zod
Python:
pip install mcp-use langchain-openai
Use tsx to run TypeScript files directly:
npx tsx server.ts
Or compile first:
npm run build
node dist/server.js

Build docs developers (and LLMs) love