Skip to content

Commit e985d1d

Browse files
committed
Some more readme updates
1 parent 9ebaa7b commit e985d1d

File tree

1 file changed

+170
-110
lines changed

1 file changed

+170
-110
lines changed

README.md

Lines changed: 170 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

4343
We welcome all kinds of [contributions](/CONTRIBUTING.md), feedback and your help in improving this project.
4444

45+
<a id="minimal-example"></a>
4546
**Minimal example**
4647

4748
```python
@@ -139,16 +140,17 @@ mcp-agent's complete documentation is available at **[docs.mcp-agent.com](https:
139140
## Table of Contents
140141

141142
- [Overview](#overview)
143+
- [Minimal example](#minimal-example)
142144
- [Quickstart](#get-started)
143145
- [Why mcp-agent](#why-use-mcp-agent)
144-
- [Core concepts](#core-concepts)
146+
- [Core concepts](#core-components)
145147
- [MCPApp](#mcpapp)
146148
- [Agents & AgentSpec](#agents--agentspec)
147149
- [Augmented LLM](#augmented-llm)
148150
- [Workflows & decorators](#workflows--decorators)
149151
- [Configuration & secrets](#configuration--secrets)
150152
- [MCP integration](#mcp-integration)
151-
- [Workflow patterns](#workflow-patterns)
153+
- [Workflow patterns](#workflows)
152154
- [Durable execution](#durable-execution)
153155
- [Agent servers](#agent-servers)
154156
- [CLI reference](#cli-reference)
@@ -158,11 +160,12 @@ mcp-agent's complete documentation is available at **[docs.mcp-agent.com](https:
158160
- [Composing workflows](#composability)
159161
- [Signals & human input](#signaling-and-human-input)
160162
- [App configuration](#app-config)
163+
- [Icons](#icons)
161164
- [MCP server management](#mcp-server-management)
162165
- [Cloud deployment](#cloud-deployment)
163166
- [Examples](#examples)
164-
- [FAQ](#faq)
165-
- [Community & contributions](#community--contributions)
167+
- [FAQ](#faqs)
168+
- [Community & contributions](#contributing)
166169

167170
## Get Started
168171

@@ -311,125 +314,34 @@ openai:
311314
<img width="2398" alt="Image" src="https://github.com/user-attachments/assets/eaa60fdf-bcc6-460b-926e-6fa8534e9089" />
312315
</details>
313316
314-
## Table of Contents
315-
316-
- [Why use mcp-agent?](#why-use-mcp-agent)
317-
- [Example Applications](#examples)
318-
- [Claude Desktop](#claude-desktop)
319-
- [Streamlit](#streamlit)
320-
- [Gmail Agent](#gmail-agent)
321-
- [RAG](#simple-rag-chatbot)
322-
- [Marimo](#marimo)
323-
- [Python](#python)
324-
- [Swarm (CLI)](#swarm)
325-
- [Core Concepts](#core-components)
326-
- [Workflows Patterns](#workflows)
327-
- [Augmented LLM](#augmentedllm)
328-
- [Parallel](#parallel)
329-
- [Router](#router)
330-
- [Intent-Classifier](#intentclassifier)
331-
- [Orchestrator-Workers](#orchestrator-workers)
332-
- [Evaluator-Optimizer](#evaluator-optimizer)
333-
- [OpenAI Swarm](#swarm-1)
334-
- [Advanced](#advanced)
335-
- [Composing multiple workflows](#composability)
336-
- [Signaling and Human input](#signaling-and-human-input)
337-
- [App Config](#app-config)
338-
- [MCP Server Management](#mcp-server-management)
339-
- [Contributing](#contributing)
340-
- [Roadmap](#roadmap)
341-
- [FAQs](#faqs)
342-
343317
## Why use `mcp-agent`?
344318
345319
There are too many AI frameworks out there already. But `mcp-agent` is the only one that is purpose-built for a shared protocol - [MCP](https://modelcontextprotocol.io/introduction). It is also the most lightweight, and is closer to an agent pattern library than a framework.
346320
347321
As [more services become MCP-aware](https://github.com/punkpeye/awesome-mcp-servers), you can use mcp-agent to build robust and controllable AI agents that can leverage those services out-of-the-box.
348322
349-
## Examples
350-
351-
Before we go into the core concepts of mcp-agent, let's show what you can build with it.
352-
353-
In short, you can build any kind of AI application with mcp-agent: multi-agent collaborative workflows, human-in-the-loop workflows, RAG pipelines and more.
354-
355-
### Claude Desktop
356-
357-
You can integrate mcp-agent apps into MCP clients like Claude Desktop.
358-
359-
#### mcp-agent server
360-
361-
This app wraps an mcp-agent application inside an MCP server, and exposes that server to Claude Desktop.
362-
The app exposes agents and workflows that Claude Desktop can invoke to service of the user's request.
363-
364-
https://github.com/user-attachments/assets/7807cffd-dba7-4f0c-9c70-9482fd7e0699
365-
366-
This demo shows a multi-agent evaluation task where each agent evaluates aspects of an input poem, and
367-
then an aggregator summarizes their findings into a final response.
368-
369-
**Details**: Starting from a user's request over text, the application:
370-
371-
- dynamically defines agents to do the job
372-
- uses the appropriate workflow to orchestrate those agents (in this case the Parallel workflow)
373-
374-
**Link to code**: [examples/basic/mcp_server_aggregator](./examples/basic/mcp_server_aggregator)
375-
376-
> [!NOTE]
377-
> Huge thanks to [Jerron Lim (@StreetLamb)](https://github.com/StreetLamb)
378-
> for developing and contributing this example!
379-
380-
### Streamlit
381-
382-
You can deploy mcp-agent apps using Streamlit.
383-
384-
#### Gmail agent
385-
386-
This app is able to perform read and write actions on gmail using text prompts -- i.e. read, delete, send emails, mark as read/unread, etc.
387-
It uses an MCP server for Gmail.
388-
389-
https://github.com/user-attachments/assets/54899cac-de24-4102-bd7e-4b2022c956e3
390-
391-
**Link to code**: [gmail-mcp-server](https://github.com/jasonsum/gmail-mcp-server/blob/add-mcp-agent-streamlit/streamlit_app.py)
392-
393-
> [!NOTE]
394-
> Huge thanks to [Jason Summer (@jasonsum)](https://github.com/jasonsum)
395-
> for developing and contributing this example!
396-
397-
#### Simple RAG Chatbot
398-
399-
This app uses a Qdrant vector database (via an MCP server) to do Q&A over a corpus of text.
323+
## Cloud deployment
400324
401-
https://github.com/user-attachments/assets/f4dcd227-cae9-4a59-aa9e-0eceeb4acaf4
325+
mcp-agent apps are portable—you can self-host or deploy to mcp-agent Cloud for managed Temporal-backed execution.
402326
403-
**Link to code**: [examples/usecases/streamlit_mcp_rag_agent](./examples/usecases/streamlit_mcp_rag_agent/)
404-
405-
> [!NOTE]
406-
> Huge thanks to [Jerron Lim (@StreetLamb)](https://github.com/StreetLamb)
407-
> for developing and contributing this example!
408-
409-
### Marimo
410-
411-
[Marimo](https://github.com/marimo-team/marimo) is a reactive Python notebook that replaces Jupyter and Streamlit.
412-
Here's the "file finder" agent from [Quickstart](#quickstart) implemented in Marimo:
413-
414-
<img src="https://github.com/user-attachments/assets/139a95a5-e3ac-4ea7-9c8f-bad6577e8597" width="400"/>
415-
416-
**Link to code**: [examples/usecases/marimo_mcp_basic_agent](./examples/usecases/marimo_mcp_basic_agent/)
417-
418-
> [!NOTE]
419-
> Huge thanks to [Akshay Agrawal (@akshayka)](https://github.com/akshayka)
420-
> for developing and contributing this example!
421-
422-
### Python
327+
```bash
328+
uv run mcp-agent login
329+
uv run mcp-agent deploy my-agent
330+
```
423331
424-
You can write mcp-agent apps as Python scripts or Jupyter notebooks.
332+
The CLI packages your project, uploads secrets, and returns an MCP endpoint (HTTP/SSE) plus workflow operations you can resume via `uv run mcp-agent workflows`.
425333
426-
#### Swarm
334+
Docs: [Cloud overview](https://docs.mcp-agent.com/cloud/overview) • [Deploy to Cloud guide](https://docs.mcp-agent.com/get-started/deploy-to-cloud)
427335
428-
This example demonstrates a multi-agent setup for handling different customer service requests in an airline context using the Swarm workflow pattern. The agents can triage requests, handle flight modifications, cancellations, and lost baggage cases.
336+
## Examples
429337
430-
https://github.com/user-attachments/assets/b314d75d-7945-4de6-965b-7f21eb14a8bd
338+
Explore the [Example Gallery](docs/examples/README.md) for runnable demos across Claude Desktop, Streamlit, Marimo, Temporal workflows, and more. Highlights:
431339
432-
**Link to code**: [examples/workflows/workflow_swarm](./examples/workflows/workflow_swarm/)
340+
- **Claude Desktop – Agent server**. Wraps an mcp-agent app in an MCP server so Claude can orchestrate multi-agent grading. [Video](https://github.com/user-attachments/assets/7807cffd-dba7-4f0c-9c70-9482fd7e0699) · [Code](./examples/basic/mcp_server_aggregator) · Thanks [@StreetLamb](https://github.com/StreetLamb).
341+
- **Streamlit Gmail agent**. Read/send mail via the Gmail MCP server with a Streamlit UI. [Video](https://github.com/user-attachments/assets/54899cac-de24-4102-bd7e-4f0c-9c70-9482fd7e0699) · [Code](https://github.com/jasonsum/gmail-mcp-server/blob/add-mcp-agent-streamlit/streamlit_app.py) · Thanks [@jasonsum](https://github.com/jasonsum).
342+
- **Streamlit RAG chatbot**. Q&A over a corpus using Qdrant through MCP. [Video](https://github.com/user-attachments/assets/f4dcd227-cae9-4a59-aa9e-0eceeb4acaf4) · [Code](./examples/usecases/streamlit_mcp_rag_agent) · Thanks [@StreetLamb](https://github.com/StreetLamb).
343+
- **Marimo notebook agent**. Reactive notebook front-end for the finder agent. <img src="https://github.com/user-attachments/assets/139a95a5-e3ac-4ea7-9c8f-bad6577e8597" width="320"/> · [Code](./examples/usecases/marimo_mcp_basic_agent) · Thanks [@akshayka](https://github.com/akshayka).
344+
- **Python Swarm CLI**. Airline support workflow using the Swarm pattern. [Video](https://github.com/user-attachments/assets/b314d75d-7945-4de6-965b-7f21eb14a8bd) · [Code](./examples/workflows/workflow_swarm).
433345
434346
## Core Components
435347
@@ -447,6 +359,16 @@ Everything in the framework is a derivative of these core capabilities.
447359
mcp-agent provides implementations for every pattern in Anthropic’s [Building Effective Agents](https://www.anthropic.com/research/building-effective-agents), as well as the OpenAI [Swarm](https://github.com/openai/swarm) pattern.
448360
Each pattern is model-agnostic, and exposed as an `AugmentedLLM`, making everything very composable.
449361
362+
| Pattern | Helper | Summary | Docs |
363+
| --------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
364+
| Parallel (Map-Reduce) | `create_parallel_llm(...)` | Fan-out specialists and fan-in aggregated reports.<br><img src="https://www.anthropic.com/_next/image?url=https%3A%2F%2Fwww-cdn.anthropic.com%2Fimages%2F4zrzovbb%2Fwebsite%2F406bb032ca007fd1624f261af717d70e6ca86286-2401x1000.png&w=3840&q=75" width="260"/> | [Parallel](https://docs.mcp-agent.com/mcp-agent-sdk/effective-patterns/map-reduce) |
365+
| Router | `create_router_llm(...)` / `create_router_embedding(...)` | Route requests to the best agent, server, or function.<br><img src="https://www.anthropic.com/_next/image?url=https%3A%2F%2Fwww-cdn.anthropic.com%2Fimages%2F4zrzovbb%2Fwebsite%2F5c0c0e9fe4def0b584c04d37849941da55e5e71c-2401x1000.png&w=3840&q=75" width="260"/> | [Router](https://docs.mcp-agent.com/mcp-agent-sdk/effective-patterns/router) |
366+
| Intent classifier | `create_intent_classifier_llm(...)` / `create_intent_classifier_embedding(...)` | Bucket user input into intents before automation. | [Intent classifier](https://docs.mcp-agent.com/mcp-agent-sdk/effective-patterns/intent-classifier) |
367+
| Orchestrator-workers | `create_orchestrator(...)` | Generate plans and coordinate worker agents.<br><img src="https://www.anthropic.com/_next/image?url=https%3A%2F%2Fwww-cdn.anthropic.com%2Fimages%2F4zrzovbb%2Fwebsite%2F8985fc683fae4780fb34eab1365ab78c7e51bc8e-2401x1000.png&w=3840&q=75" width="260"/> | [Planner](https://docs.mcp-agent.com/mcp-agent-sdk/effective-patterns/planner) |
368+
| Deep research | `create_deep_orchestrator(...)` | Long-horizon research with knowledge extraction and policy checks. | [Deep research](https://docs.mcp-agent.com/mcp-agent-sdk/effective-patterns/deep-research) |
369+
| Evaluator-optimizer | `create_evaluator_optimizer_llm(...)` | Iterate until an evaluator approves the result.<br><img src="https://www.anthropic.com/_next/image?url=https%3A%2F%2Fwww-cdn.anthropic.com%2Fimages%2F4zrzovbb%2Fwebsite%2F14f51e6406ccb29e695da48b17017e899a6119c7-2401x1000.png&w=3840&q=75" width="260"/> | [Evaluator-optimizer](https://docs.mcp-agent.com/mcp-agent-sdk/effective-patterns/evaluator-optimizer) |
370+
| Swarm | `create_swarm(...)` | Multi-agent handoffs compatible with OpenAI Swarm.<br><img src="https://github.com/openai/swarm/blob/main/assets/swarm_diagram.png?raw=true" width="220"/> | [Swarm](https://docs.mcp-agent.com/mcp-agent-sdk/effective-patterns/swarm) |
371+
450372
### AugmentedLLM
451373
452374
[AugmentedLLM](./src/mcp_agent/workflows/llm/augmented_llm.py) is an LLM that has access to MCP servers and functions via Agents.
@@ -662,8 +584,107 @@ print("Result:", result)
662584
663585
</details>
664586
587+
## Durable execution
588+
589+
Switch `execution_engine` to `temporal` when you want long-running workflows with retries, pause/resume, and audit history. The workflow code stays the same—mcp-agent handles Temporal activities and signals for you.
590+
591+
```python
592+
from mcp_agent.app import MCPApp
593+
from mcp_agent.config import Settings
594+
from mcp_agent.executor.workflow import Workflow, WorkflowResult
595+
596+
app = MCPApp(name="durable_app", settings=Settings(execution_engine="temporal"))
597+
598+
@app.workflow
599+
class PauseResumeWorkflow(Workflow[str]):
600+
@app.workflow_run
601+
async def run(self, message: str) -> WorkflowResult[str]:
602+
await self.context.executor.wait_for_signal("resume", workflow_id=self.id)
603+
return WorkflowResult(value=f"Resumed: {message}")
604+
```
605+
606+
Run a Temporal worker with `uv run mcp-agent workflows run ...` or see [`examples/temporal`](./examples/temporal) for a full setup with resume commands.
607+
608+
Docs: [Durable agents](https://docs.mcp-agent.com/mcp-agent-sdk/advanced/durable-agents)
609+
610+
## Agent servers
611+
612+
Expose any MCPApp as an MCP server so Claude, Cursor, VS Code, or other agents can call your workflows.
613+
614+
```python
615+
from mcp_agent.server.app_server import create_mcp_server_for_app
616+
617+
async def main():
618+
async with app.run() as running_app:
619+
server = create_mcp_server_for_app(running_app)
620+
await server.run_stdio_async()
621+
```
622+
623+
The server automatically exports decorated tools (`@app.tool`, `@app.async_tool`) plus management endpoints such as `workflows-list` and `workflows-get_status`.
624+
625+
Docs: [Agent as MCP server](https://docs.mcp-agent.com/mcp-agent-sdk/mcp/agent-as-mcp-server)
626+
627+
## CLI reference
628+
629+
```bash
630+
uvx mcp-agent --help
631+
```
632+
633+
- `uvx mcp-agent init` – scaffold a project.
634+
- `uvx mcp-agent deploy` – deploy to mcp-agent Cloud.
635+
636+
Docs: [CLI reference](https://docs.mcp-agent.com/reference/cli)
637+
638+
## Authentication
639+
640+
Add API keys or OAuth credentials once in config and mcp-agent manages the rest.
641+
642+
```yaml
643+
mcp:
644+
servers:
645+
github:
646+
command: "uvx"
647+
args: ["mcp-server-github"]
648+
auth:
649+
oauth:
650+
enabled: true
651+
client_id: ${GITHUB_CLIENT_ID}
652+
client_secret: ${GITHUB_CLIENT_SECRET}
653+
```
654+
655+
Docs: [Authentication](https://docs.mcp-agent.com/mcp-agent-sdk/advanced/authentication) • [Server authentication](https://docs.mcp-agent.com/mcp-agent-sdk/mcp/server-authentication)
656+
665657
## Advanced
666658
659+
### Observability & controls
660+
661+
Enable structured logging and OpenTelemetry via configuration, and track token usage programmatically.
662+
663+
```yaml
664+
# mcp_agent.config.yaml
665+
logger:
666+
transports: [console]
667+
level: info
668+
otel:
669+
enabled: true
670+
exporters:
671+
- console
672+
```
673+
674+
```python
675+
summary = await app.context.token_counter.get_summary()
676+
print("Total tokens:", summary.usage.total_tokens)
677+
678+
async def report_usage(usage):
679+
print("Tokens updated", usage.total_tokens)
680+
681+
watch_id = await app.context.token_counter.watch(report_usage)
682+
# ... later
683+
await app.context.token_counter.unwatch(watch_id)
684+
```
685+
686+
Docs: [Observability](https://docs.mcp-agent.com/mcp-agent-sdk/advanced/observability) • [`examples/tracing`](./examples/tracing)
687+
667688
### Composability
668689
669690
An example of composability is using an [Evaluator-Optimizer](#evaluator-optimizer) workflow as the planner LLM inside
@@ -764,6 +785,31 @@ If you inject your own `FastMCP` instance into an `MCPApp`, you will have to add
764785
765786
### App Config
766787
788+
Define an `mcp_agent.config.yaml` for servers, logging, and execution settings, or construct `Settings` programmatically when embedding mcp-agent.
789+
790+
```yaml
791+
# mcp_agent.config.yaml
792+
execution_engine: asyncio
793+
mcp:
794+
servers:
795+
fetch:
796+
command: "uvx"
797+
args: ["mcp-server-fetch"]
798+
```
799+
800+
```python
801+
from mcp_agent.app import MCPApp
802+
from mcp_agent.config import Settings, MCPSettings, MCPServerSettings
803+
804+
settings = Settings(
805+
execution_engine="asyncio",
806+
mcp=MCPSettings(servers={
807+
"fetch": MCPServerSettings(command="uvx", args=["mcp-server-fetch"]),
808+
}),
809+
)
810+
app = MCPApp(name="configured_app", settings=settings)
811+
```
812+
767813
Create an [`mcp_agent.config.yaml`](/schema/mcp-agent.config.schema.json) and define secrets via either a gitignored [`mcp_agent.secrets.yaml`](./examples/basic/mcp_basic_agent/mcp_agent.secrets.yaml.example) or a local [`.env`](./examples/basic/mcp_basic_agent/.env.example). In production, prefer `MCP_APP_SETTINGS_PRELOAD` to avoid writing plaintext secrets to disk.
768814
769815
### MCP server management
@@ -875,6 +921,12 @@ There have already been incredible community contributors who are driving this p
875921
- [Jerron Lim (@StreetLamb)](https://github.com/StreetLamb) -- who has contributed countless hours and excellent examples, and great ideas to the project.
876922
- [Jason Summer (@jasonsum)](https://github.com/jasonsum) -- for identifying several issues and adapting his Gmail MCP server to work with mcp-agent
877923
924+
<p align="center">
925+
<a href="https://github.com/lastmile-ai/mcp-agent/graphs/contributors">
926+
<img src="https://contrib.rocks/image?repo=lastmile-ai/mcp-agent" alt="Contributor faces" />
927+
</a>
928+
</p>
929+
878930
## Roadmap
879931
880932
We will be adding a detailed roadmap (ideally driven by your feedback). The current set of priorities include:
@@ -920,6 +972,14 @@ You can embed mcp-agent in an MCP client directly to manage the orchestration ac
920972
921973
You can use mcp-agent applications in a standalone fashion (i.e. they aren't part of an MCP client). The [`examples`](/examples/) are all standalone applications.
922974
975+
### How do I deploy to Cloud?
976+
977+
Run `uvx mcp-agent deploy <app-name>` after logging in with `uvx mcp-agent login`. The CLI packages your project, provisions secrets, and exposes an MCP endpoint backed by a durable Temporal runtime. See the [Cloud quickstart](https://docs.mcp-agent.com/get-started/deploy-to-cloud) for step-by-step screenshots and CLI output.
978+
979+
### Where is the API reference?
980+
981+
Every class, decorator, and CLI command is documented on [docs.mcp-agent.com](https://docs.mcp-agent.com). The [API reference](https://docs.mcp-agent.com/reference) and the [`llms-full.txt`](https://docs.mcp-agent.com/llms-full.txt) are designed so LLMs (or you) can ingest the whole surface area easily.
982+
923983
### Tell me a fun fact
924984
925985
I debated naming this project _silsila_ (سلسلہ), which means chain of events in Urdu. mcp-agent is more matter-of-fact, but there's still an easter egg in the project paying homage to silsila.

0 commit comments

Comments
 (0)