Co-authored-by: Bo Zhang <187063395+Tethys0@users.noreply.github.com>
Examples
This directory contains examples for both Python and TypeScript implementations of mcp-use.
Templates — ready-to-deploy example apps
If you're looking for full example apps you can deploy in one click (Chart Builder, Diagram Builder, Slide Deck, Maps Explorer, Widget Gallery, and more), see the dedicated Templates gallery in the main README — or browse the Templates page in the docs. Each template lives in its own repo with a live demo URL and a one-click deploy button.
The examples below are in-repo code samples meant to illustrate specific APIs and patterns — not deployable apps.
Quick Links
- Python Examples - Python client, server, and agent examples
- TypeScript Examples - TypeScript/JavaScript examples (see also agent and server)
Local Development
When you clone this repository locally, you'll find python/ and typescript/ subdirectories here that are symbolic links to the actual example directories. These symlinks make it convenient to access examples from the repository root.
Python Examples
Client Examples
- HTTP Example - Basic HTTP client usage
- Stream Example - Streaming responses
- Code Mode Example - Code mode execution
- Direct Tool Call - Direct tool invocation
- Multi-Server Example - Working with multiple servers
Server Examples
- Basic Server - Simple server implementation
- Middleware Example - Server middleware
- Context Example - Server context usage
- OAuth Example - OAuth authentication
- OAuth Dynamic Client Registration - RFC 7591 dynamic client registration
- OAuth Preregistered Client - Using a preregistered OAuth client
- Client Middleware Example - Client-side middleware pipeline
- Sandbox Everything - E2B sandbox all MCP features
- Server Manager - Dynamic multi-server management
Agent Examples
- Chat Example - Basic chat agent
- MCP Everything - Comprehensive MCP usage
- Structured Output - Structured responses
- Limited Memory Chat - Memory management
- Multimodal Input - Multimodal processing
Integration Examples
- OpenAI Integration - OpenAI API integration
- Anthropic Integration - Anthropic API integration
- LangChain Integration - LangChain integration
- Google Integration - Google API integration
MCP Server Integrations
- Airbnb MCP - Airbnb integration
- Blender Use - Blender integration
- Browser Use - Browser automation
- Filesystem Use - Filesystem operations
TypeScript Examples
Client Examples
- CommonJS Example - CommonJS usage
- CLI Examples - Command-line interface examples
- React Integration - React client examples
- Notifications Client - Notification handling
- Sampling Client - Sampling configuration
Server Examples
- Basic Server - Simple server implementation
- Server Features - Advanced features
- Conformance - MCP conformance test server
- Elicitation - Form and URL elicitation
- Sampling - Server-initiated LLM sampling
- Notifications - Bidirectional notifications
- Skills over MCP - Publish Agent Skills and supporting files
- Middleware - Built-in middleware pipeline
- Proxy - Proxy MCP server
- OAuth Examples - OAuth implementations
- MCP Apps view examples — current
viewAPI and React hooks- Basic - Typed tool output, view tools, host context, and display modes
- File Upload - File-manager view using
useFiles - Story Writer - Interactive story-writing view
- Tic-tac-toe - Stateful game UI
- Excalidraw - Canvas-based view
Agent Examples
- Agent examples — native and LangChain MCP agents
- Basic Examples - Basic agent patterns
- Advanced Examples - Advanced patterns
- Code Mode - Code execution
- Frameworks - Framework integrations
- Integrations - MCP server integrations
- Server Management - Dynamic server management