https://github.com/mcp-use/mcp-use
mcp-use is the easiest way to interact with mcp servers with custom agents
https://github.com/mcp-use/mcp-use
agentic-framework ai apps-sdk chatgpt claude-code llms mcp mcp-apps mcp-client mcp-gateway mcp-host mcp-inspector mcp-server mcp-servers mcp-tools mcp-ui model-context-protocol modelcontextprotocol python typescript
Last synced: about 21 hours ago
JSON representation
mcp-use is the easiest way to interact with mcp servers with custom agents
- Host: GitHub
- URL: https://github.com/mcp-use/mcp-use
- Owner: mcp-use
- License: mit
- Created: 2025-03-28T10:06:31.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2026-01-22T16:33:51.000Z (19 days ago)
- Last Synced: 2026-01-23T02:37:48.928Z (19 days ago)
- Topics: agentic-framework, ai, apps-sdk, chatgpt, claude-code, llms, mcp, mcp-apps, mcp-client, mcp-gateway, mcp-host, mcp-inspector, mcp-server, mcp-servers, mcp-tools, mcp-ui, model-context-protocol, modelcontextprotocol, python, typescript
- Language: TypeScript
- Homepage: https://mcp-use.com
- Size: 106 MB
- Stars: 8,981
- Watchers: 58
- Forks: 1,096
- Open Issues: 35
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-github-repos - mcp-use/mcp-use - mcp-use is the easiest way to interact with mcp servers with custom agents (TypeScript)
- awesome-mcp-enterprise - mcp-use - Open-source toolkit to connect any LLM to any MCP server and build custom MCP agents with tool access. ๐ (Build Tools & Frameworks)
- awesome-mcp-servers - <div align="center"><img src="https://raw.githubusercontent.com/pietrozullo/mcp-use/refs/heads/main/docs/favicon.svg" height="20"/></div> - use](https://github.com/pietrozullo/mcp-use) | [mcp-use x MCP](https://docs.mcp-use.io/introduction) | (Supported Clients)
- awesome-ChatGPT-repositories - mcp-use - mcp-use is the easiest way to interact with mcp servers with custom agents (The latest additions ๐)
- awesome-mcp-servers - **mcp-use** - mcp-use is the easiest way to interact with mcp servers with custom agents `python` `agent` `agents` `ai` `mcp` `pip install git+https://github.com/mcp-use/mcp-use` (๐ค AI/ML)
- awesome-starts - mcp-use/mcp-use - mcp-use is the easiest way to interact with mcp servers with custom agents (python)
- StarryDivineSky - mcp-use/mcp-use - use้กน็ฎๆจๅจ็ฎๅไธMCPๆๅกๅจ็ไบคไบ๏ผ็นๅซๆฏไฝฟ็จ่ชๅฎไนไปฃ็็ๆ ๅตใๅฎๆไพไบไธ็ง็ฎๅๆ็จ็ๆนๅผๆฅ่ฟๆฅๅๆไฝMCPๆๅกๅจใ่ฏฅ้กน็ฎ็ๆ ธๅฟไผๅฟๅจไบๅ ถๆ็จๆง๏ผไฝฟๅพ็จๆทๅฏไปฅๅฟซ้ไธๆๅนถ่ฟ่ก่ชๅฎไนไปฃ็็้ๆใๅ ทไฝๅฎ็ฐๅ็ๅฏ่ฝๆถๅ็ฝ็ป้ไฟกใๅ่ฎฎ่งฃๆไปฅๅไปฃ็้ ็ฝฎ็ญๆๆฏใ้่ฟmcp-use๏ผๅผๅ่ ๅฏไปฅๆด้ซๆๅฐๆๅปบๅ็ฎก็ๅบไบMCPๆๅกๅจ็ๅบ็จ็จๅบ๏ผ้ไฝๅผๅๅ็ปดๆคๆๆฌใ้กน็ฎๅฏ่ฝๅ ๅซ็คบไพไปฃ็ ๅ่ฏฆ็ปๆๆกฃ๏ผๆนไพฟ็จๆท็่งฃๅไฝฟ็จใๆปไฝๆฅ่ฏด๏ผmcp-useๆฏไธไธชๆนไพฟๅผๅ่ ไธMCPๆๅกๅจไบคไบ็ๅฎ็จๅทฅๅ ท๏ผๅฐคๅ ถ้็จไบ้่ฆ่ชๅฎไนไปฃ็็ๅบๆฏใ (A01_ๆๆฌ็ๆ_ๆๆฌๅฏน่ฏ / ๅคง่ฏญ่จๅฏน่ฏๆจกๅๅๆฐๆฎ)
- metorial-index - MCP-Use - Connects LLMs to various tools, enabling web browsing and file operations for building custom AI agents. Facilitates the integration of diverse capabilities into applications without relying on proprietary solutions. (Content Creation)
- awesome-rainmana - mcp-use/mcp-use - mcp-use is the easiest way to interact with mcp servers with custom agents (TypeScript)
- awesome - mcp-use/mcp-use - mcp-use is the easiest way to interact with mcp servers with custom agents (TypeScript)
- awesome-mcp - mcp-use/mcp-use - mcp-use is an open-source client library that enables easy connection of any tool-capable LLM to MCP servers for building custom agents with diverse tool access. (MCP Frameworks and libraries / Python)
- awesome-ai-agents - mcp-use/mcp-use - mcp-use is an open-source unified client library that enables seamless integration of any LangChain-supported LLM with MCP servers to build custom agents with tool access. (Agent Integration & Deployment Tools / AI Agent Operating System)
- awesome-mcp-devtools - mcp-use - Open source python library to very easily connect any LLM to any MCP server both locally and remotely. (SDKs / Python)
- awesome-context-engineering - mcp-use - use`)  mcp-use is the easiest way to interact with mcp servers with custom agents (๐ Select Context / MCP Frameworks)
README
ย
ย
mcp-use provides everything you need to build with Model Context Protocol
MCP servers, MCP clients and AI agents in 6 lines of code, in both Python and TypeScript.
---
## 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?
๐ค Build an AI Agent
Create intelligent agents that can use tools, browse the web, manage files, and more.
Quick Start โ |
Python Docs |
TypeScript Docs
๐ Use MCP Client
Connect directly to MCP servers and call tools programmatically without an agent.
Quick Start โ |
Python Docs |
TypeScript Docs
๐ ๏ธ Create an MCP Server
Build your own MCP servers with tools, resources, and prompts.
Quick Start โ |
Python Docs |
TypeScript Docs
๐ Debug with Inspector
Test, debug, and explore your MCP servers interactively.
Quick Start โ |
Inspector Docs |
MCP Inspector online
๐จ Build ChatGPT Apps
Create interactive UIs with mcp-ui, react and live reload.
โ๏ธ Deploy to MCP Cloud
Deploy and manage your MCP agents and servers in the cloud.
---
๐ฆ 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