The v2 merge deleted libraries/typescript/packages/mcp-use, so 26 of the 86 relative links in examples/README.md are dead. This fixes the 17 that have an exact home in the v2 tree: client examples moved to packages/client/examples, and the server ones lost the features/ grouping and renamed oauth/ to auth/. The remaining 9 point at examples with no v2 counterpart at all, so fixing them means dropping the entry or aiming it somewhere approximate. Left untouched pending a call on those.
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
- Node HTTP Client - Node/HTTP client with tool calls, sampling, elicitation, notifications
- 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
- Everything - All MCP primitives in one server
- Conformance - MCP conformance test server
- Elicitation - Form and URL elicitation
- Sampling - Server-initiated LLM sampling
- Notifications - Bidirectional notifications
- Completion - Autocomplete for prompt args
- Streaming Props - Stream tool props to widgets
- Middleware - Built-in middleware pipeline
- Express Middleware - Express/Hono integration
- Session Management - Memory, filesystem, Redis storage
- Proxy - Proxy MCP server
- Client Info - Access client capabilities
- DNS Rebinding - DNS rebinding protection
- OAuth Examples - OAuth implementations
- Deployment - Deployment examples
- 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