# mcp-use
**Repository Path**: mirrors_trending/mcp-use
## Basic Information
- **Project Name**: mcp-use
- **Description**: mcp-use is the easiest way to interact with mcp servers with custom agents
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 1
- **Forks**: 0
- **Created**: 2025-04-17
- **Last Updated**: 2026-02-14
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
---
## Stack
- **π€ MCP Agents** - AI agents that can use tools and reason across steps
- **π MCP Clients** - Connect any LLM to any MCP server
- **π οΈ MCP Servers** - Build your own MCP servers
- **π MCP Inspector** - Web-based debugger for MCP servers
- **π¨ MCP-UI Resources** - Build ChatGPT apps with interactive widgets
---
π What Do You Want to Build?
---
π¦ Quick Start
### Build an AI Agent
Create an AI agent that can use MCP tools to accomplish complex tasks.
####
Python
```bash
pip install mcp-use langchain-openai
```
```python
import asyncio
from langchain_openai import ChatOpenAI
from mcp_use import MCPAgent, MCPClient
async def main():
# Configure MCP server
config = {
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
}
}
}
client = MCPClient.from_dict(config)
llm = ChatOpenAI(model="gpt-4o")
agent = MCPAgent(llm=llm, client=client)
result = await agent.run("List all files in the directory")
print(result)
asyncio.run(main())
```
[**β Full Python Agent Documentation**](./libraries/python/README.md#quick-start)
####
Typescript
```bash
npm install mcp-use @langchain/openai
```
```typescript
import { ChatOpenAI } from "@langchain/openai";
import { MCPAgent, MCPClient } from "mcp-use";
async function main() {
// Configure MCP server
const config = {
mcpServers: {
filesystem: {
command: "npx",
args: ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
},
},
};
const client = MCPClient.fromDict(config);
const llm = new ChatOpenAI({ modelName: "gpt-4o" });
const agent = new MCPAgent({ llm, client });
const result = await agent.run("List all files in the directory");
console.log(result);
}
main();
```
[**β Full TypeScript Agent Documentation**](./libraries/typescript/README.md#-quick-start)
---
### Use MCP Client
Connect to MCP servers directly without an AI agent for programmatic tool access.
####
Python
```python
import asyncio
from mcp_use import MCPClient
async def main():
config = {
"mcpServers": {
"calculator": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-everything"]
}
}
}
client = MCPClient.from_dict(config)
await client.create_all_sessions()
session = client.get_session("calculator")
result = await session.call_tool(name="add", arguments={"a": 5, "b": 3})
print(f"Result: {result.content[0].text}")
await client.close_all_sessions()
asyncio.run(main())
```
[**β Python Client Documentation**](./libraries/python/README.md#direct-tool-calls-without-llm)
####
Typescript
```typescript
import { MCPClient } from "mcp-use";
async function main() {
const config = {
mcpServers: {
calculator: {
command: "npx",
args: ["-y", "@modelcontextprotocol/server-everything"],
},
},
};
const client = new MCPClient(config);
await client.createAllSessions();
const session = client.getSession("calculator");
const result = await session.callTool("add", { a: 5, b: 3 });
console.log(`Result: ${result.content[0].text}`);
await client.closeAllSessions();
}
main();
```
[**β TypeScript Client Documentation**](./libraries/typescript/README.md#basic-usage)
---
### Create an MCP Server
Build your own MCP server with custom tools, resources, and prompts.
####
Typescript
```bash
npx create-mcp-use-app my-server
cd my-server
npm install
```
```typescript
import { MCPServer, text } from "mcp-use/server";
import { z } from "zod";
const server = new MCPServer({
name: "my-server",
version: "1.0.0",
description: "My custom MCP server",
});
// Define a tool
server.tool(
{
name: "get_weather",
description: "Get weather for a city",
schema: z.object({
city: z.string().describe("City name"),
}),
},
async ({ city }) => {
return text(`Temperature: 72Β°F, Condition: sunny, City: ${city}`);
}
);
// Start server with auto-inspector
server.listen(3000);
// π Inspector at http://localhost:3000/inspector
```
[**β Full TypeScript Server Documentation**](./libraries/typescript/README.md#%EF%B8%8F-mcp-server-framework)
####
Python
**Coming Soon!** For now, please use the TypeScript implementation to create MCP servers.
---
### Use the Inspector
Debug and test your MCP servers with the interactive web-based inspector.
#### Automatic (with mcp-use server)
When you create a server with `mcp-use`, the inspector is automatically available:
```typescript
server.listen(3000);
// Inspector automatically at: http://localhost:3000/inspector
```
#### Standalone
Inspect any MCP server via CLI:
```bash
npx @mcp-use/inspector --url http://localhost:3000/sse
```
**Features:**
- π Test tools interactively with live execution
- π Monitor connection status and server health
- π Handle OAuth flows automatically
- πΎ Persistent sessions with localStorage
[**β Full Inspector Documentation**](./libraries/typescript/packages/inspector/README.md)
---
## π More Examples & Documentation
### Example Use Cases
- **[Web Browsing with Playwright](./libraries/python/README.md#web-browsing-with-playwright)** - Automate browser tasks
- **[Multi-Server Setup](./libraries/python/README.md#multi-server-support)** - Use multiple MCP servers together
- **[Streaming Responses](./libraries/python/README.md#streaming-agent-output)** - Real-time agent output
- **[UI Widgets](./libraries/typescript/README.md#building-custom-ui-widgets)** - Build interactive React components
- **[AI SDK Integration](./libraries/typescript/README.md#-ai-sdk-integration)** - Vercel AI SDK for Next.js apps
### Complete Documentation
- **[π Python Documentation](./libraries/python/README.md)** - Complete Python guide
- **[π TypeScript Documentation](./libraries/typescript/README.md)** - Complete TypeScript guide
- **[π Inspector Documentation](./libraries/typescript/packages/inspector/README.md)** - Inspector guide
- **[π Online Docs](https://mcp-use.com/docs)** - Full online documentation
---
## β¨ Key Features
| Feature |
Description |
Python |
TypeScript |
| π€ MCP Agents |
AI agents with tool access and multi-step reasoning |
β
|
β
|
| π MCP Clients |
Direct connection to any MCP server |
β
|
β
|
| π οΈ MCP Servers |
Build custom MCP servers |
π |
β
|
| π Inspector |
Web-based debugging tool |
β
|
β
|
| π¨ UI Widgets |
Build interactive React UIs |
β |
β
|
| π Multi-Server |
Connect to multiple servers simultaneously |
β
|
β
|
| π‘ Streaming |
Real-time streaming responses |
β
|
β
|
| π Observability |
Built-in Langfuse integration |
β
|
β
|
| π OAuth Support |
Built-in OAuth flow handling |
β
|
β
|
| π‘οΈ Tool Control |
Restrict access to specific tools |
β
|
β
|
---
## π¦ Package Overview
This monorepo contains multiple packages for both Python and TypeScript:
### Python Packages
| Package | Description | Version |
| ----------- | ------------------------------------- | --------------------------------------------------------------------------------------- |
| **mcp-use** | Complete MCP client and agent library | [](https://pypi.org/project/mcp_use/) |
### TypeScript Packages
| Package | Description | Version |
| ---------------------- | ----------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| **mcp-use** | Core framework for clients, agents, and servers | [](https://www.npmjs.com/package/mcp-use) |
| **@mcp-use/cli** | Build tool with hot reload and auto-inspector | [](https://www.npmjs.com/package/@mcp-use/cli) |
| **@mcp-use/inspector** | Web-based debugger for MCP servers | [](https://www.npmjs.com/package/@mcp-use/inspector) |
| **create-mcp-use-app** | Project scaffolding tool | [](https://www.npmjs.com/package/create-mcp-use-app) |
---
## ποΈ Repository Structure
```
mcp-use/
βββ libraries/
β βββ python/ β Python implementation
β β βββ mcp_use/ β Core library
β β βββ examples/ β Python examples
β β βββ docs/ β Python documentation
β β
β βββ typescript/ β TypeScript implementation
β βββ packages/
β βββ mcp-use/ β Core framework
β βββ cli/ β Build tool
β βββ inspector/ β Web inspector
β βββ create-mcp-use-app/ β Scaffolding
βββ README.md β This file
```
---
## π Why MCP-Use?
### Complete Vertical Stack
Build everything from AI agents to servers - not just clients. Create the full MCP ecosystem in your preferred language.
### Language Flexibility
Choose Python for ML/data workflows or TypeScript for web applications. Same great features, different languages.
### Production Ready
Includes observability, streaming, multi-server support, sandboxing, and tool access controls out of the box.
### Developer Experience
Hot reload, TypeScript/Python type safety, built-in inspector, and comprehensive documentation.
### Open Source
MIT licensed and community-driven. Contribute, fork, or extend as needed.
---
## π€ Community & Support
- **π¬ Discord**: [Join our community](https://discord.gg/XkNkSkMz3V)
- **π GitHub Issues**: [Report bugs or request features](https://github.com/mcp-use/mcp-use/issues)
- **π Documentation**: [mcp-use.com/docs](https://mcp-use.com/docs)
- **π Website**: [mcp-use.com](https://mcp-use.com)
- **π¦ Twitter**: Follow [@pietrozullo](https://x.com/pietrozullo) and [@pederzh](https://x.com/pederzh)
---
## π License
MIT Β© [MCP-Use Contributors](https://github.com/mcp-use/mcp-use/graphs/contributors)
---
## π Contributing
We love contributions! Check out our contributing guidelines:
[CONTRIBUTING.md](https://github.com/mcp-use/mcp-use/blob/main/CONTRIBUTING.md)
---
## β Star History
[](https://www.star-history.com/#mcp-use/mcp-use&Date)
---
## π Citation
If you use MCP-Use in your research or project, please cite:
```bibtex
@software{mcp_use2025,
author = {Zullo, Pietro and Contributors},
title = {MCP-Use: Complete MCP Ecosystem for Python and TypeScript},
year = {2025},
publisher = {GitHub},
url = {https://github.com/mcp-use/mcp-use}
}
```
---
## Contributors
Thanks to all our amazing contributors!
### Core Contributors
1. **Pietro** ([@pietrozullo](https://github.com/pietrozullo))
2. **Luigi** ([@pederzh](https://github.com/pederzh))
3. **Enrico** ([@tonxxd](https://github.com/tonxxd))
---
Built with β€οΈ by the MCP-Use community
San Francisco | ZΓΌrich