# Fast Agent

> Code, Build and Evaluate agents - excellent Model and Skills/MCP/ACP Support

- **Type:** MCP server
- **Install:** `agentstack add mcp-evalstate-fast-agent`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [evalstate](https://agentstack.voostack.com/s/evalstate)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [evalstate](https://github.com/evalstate)
- **Source:** https://github.com/evalstate/fast-agent
- **Website:** https://fast-agent.ai

## Install

```sh
agentstack add mcp-evalstate-fast-agent
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

## Start Here

> [!TIP]
> Please see https://fast-agent.ai for latest documentation.

**`fast-agent`** is a flexible way to interact with LLMs, excellent for use as a Coding Agent, Development Toolkit, Evaluation or Workflow platform.

To start an interactive session with shell support, install [uv](https://astral.sh/uv) and run

```bash
uvx fast-agent-mcp@latest -x
```

To start coding with Hugging Face inference providers or use your OpenAI Codex plan:

```bash
# Code with Hugging Face Inference Providers
uvx fast-agent-mcp@latest --pack hf-dev

# Code with Codex (agents optimized for OpenAI)
uvx fast-agent-mcp@latest --pack codex
```

Enter a shell with `!`, or run shell commands e.g. `! cd web && npm run build`.

Manage skills with the `/skills` command, and connect to MCP Servers with `/connect`. The default **`fast-agent`** registry contains skills to let you set up LSP, Agent and Tool Hooks, Compaction strategies, Automation and more.

```bash
# /connect supports stdio or streamable http (with OAuth)

# Start a STDIO server
/connect @modelcontextprotocol/server-everything

# Connect to a Streamable HTTP Server
/connect https://huggingface.co/mcp
```

It's recommended to install **`fast-agent`** to set up the shell aliases and other tooling.

```bash
# Install fast-agent
uv tool install -U fast-agent-mcp

# Run fast-agent with opus, shell support and subagent/smart mode
fast-agent --model opus -x --smart
```

Use local models with the generic provider, or automatically create the correct configuration for `llama.cpp`:

```bash
fast-agent model llamacpp
```

Any **`fast-agent`** setup or program can be used with any ACP client - the simplest way is to use `fast-agent-acp`:

```bash
# Run fast-agent inside Toad
toad acp "fast-agent-acp -x --model sonnet"
```

**`fast-agent`** enables you to create and interact with sophisticated multimodal Agents and Workflows in minutes. It is the first framework with complete, end-to-end tested MCP Feature support including Sampling and Elicitations.

`fast-agent` is CLI-first, with an optional prompt_toolkit-powered interactive terminal prompt (TUI-style input, completions, and in-terminal menus); responses can stream live to the terminal via rich without relying on full-screen curses UIs or external GUI overlays.

The simple declarative syntax lets you concentrate on composing your Prompts and MCP Servers to [build effective agents](https://www.anthropic.com/research/building-effective-agents).

Model support is comprehensive with native support for Anthropic, OpenAI and Google providers as well as Azure, Ollama, Deepseek and dozens of others via TensorZero. Structured Outputs, PDF and Vision support is simple to use and well tested. Passthrough and Playback LLMs enable rapid development and test of Python glue-code for your applications.

Recent features include:

- Agent Skills (SKILL.md)
- MCP-UI Support |
- OpenAI Apps SDK (Skybridge)
- Shell Mode
- Advanced MCP Transport Diagnsotics
- MCP Elicitations

`fast-agent` is the only tool that allows you to inspect Streamable HTTP Transport usage - a critical feature for ensuring reliable, compliant deployments. OAuth is supported with KeyRing storage for secrets. Use the `fast-agent auth` command to manage.

> [!IMPORTANT]
>
> Documentation is included in this repository under `docs/`. Use the docs helper script from the
> repository root to install, generate, build, serve, screenshot, and assess the site.

### Agent Application Development

Prompts and configurations that define your Agent Applications are stored in simple files, with minimal boilerplate, enabling simple management and version control.

Chat with individual Agents and Components before, during and after workflow execution to tune and diagnose your application. Agents can request human input to get additional context for task completion.

Simple model selection makes testing Model  MCP Server interaction painless. You can read more about the motivation behind this project [here](https://llmindset.co.uk/resources/fast-agent/)

## Get started:

Start by installing the [uv package manager](https://docs.astral.sh/uv/) for Python. Then:

```bash
uv pip install fast-agent-mcp          # install fast-agent!
fast-agent go                          # start an interactive session
fast-agent go --url https://hf.co/mcp  # with a remote MCP
fast-agent go --model=generic.qwen2.5  # use ollama qwen 2.5
fast-agent go --pack analyst --model haiku  # install/reuse a card pack and launch it
fast-agent scaffold                    # create an example agent and config files
uv run agent.py                        # run your first agent
uv run agent.py --model='gpt-5.4-mini?reasoning=low'    # specify a model
uv run agent.py --transport http --port 8001  # expose as MCP server (server mode implied)
fast-agent quickstart workflow  # create "building effective agents" examples
```

For packaged starter agents, use `fast-agent go --pack  --model `.
This installs the pack into the selected fast-agent environment if needed, then
starts `go` normally. `--model` is a fallback for cards without an explicit
model setting; a model declared directly in an AgentCard still wins.

Other quickstart examples include a Researcher Agent (with Evaluator-Optimizer workflow) and Data Analysis Agent (similar to the ChatGPT experience), demonstrating MCP Roots support.

> [!TIP]
> Windows Users - there are a couple of configuration changes needed for the Filesystem and Docker MCP Servers - necessary changes are detailed within the configuration files.

### Basic Agents

Defining an agent is as simple as:

```python
@fast.agent(
  instruction="Given an object, respond only with an estimate of its size."
)
```

We can then send messages to the Agent:

```python
async with fast.run() as agent:
  moon_size = await agent("the moon")
  print(moon_size)
```

Or start an interactive chat with the Agent:

```python
async with fast.run() as agent:
  await agent.interactive()
```

Here is the complete `sizer.py` Agent application, with boilerplate code:

```python
import asyncio
from fast_agent import FastAgent

# Create the application
fast = FastAgent("Agent Example")

@fast.agent(
  instruction="Given an object, respond only with an estimate of its size."
)
async def main():
  async with fast.run() as agent:
    await agent.interactive()

if __name__ == "__main__":
    asyncio.run(main())
```

The Agent can then be run with `uv run sizer.py`.

Specify a model with the `--model` switch - for example `uv run sizer.py --model sonnet`.

Model strings also accept query overrides. For example:

- `uv run sizer.py --model "gpt-5?reasoning=low"`
- `uv run sizer.py --model "claude-sonnet-4-6?web_search=on"`
- `uv run sizer.py --model "claude-sonnet-4-5?context=1m"`

For Anthropic models, `?context=1m` is only needed for earlier Sonnet 4 / Sonnet 4.5
models that still require the explicit 1M context opt-in. Claude Sonnet 4.6 and
Claude Opus 4.6 already use their long context window by default, so `?context=1m`
is accepted for backward compatibility but is unnecessary there.

### Combining Agents and using MCP Servers

_To generate examples use `fast-agent quickstart workflow`. This example can be run with `uv run workflow/chaining.py`. Place `fast-agent.yaml` in the active fast-agent home, or pass an explicit config path when needed._

Agents can be chained to build a workflow, using MCP Servers defined in the `fast-agent.yaml` file:

```python
@fast.agent(
    "url_fetcher",
    "Given a URL, provide a complete and comprehensive summary",
    servers=["fetch"], # Name of an MCP Server defined in fast-agent.yaml
)
@fast.agent(
    "social_media",
    """
    Write a 280 character social media post for any given text.
    Respond only with the post, never use hashtags.
    """,
)
@fast.chain(
    name="post_writer",
    sequence=["url_fetcher", "social_media"],
)
async def main():
    async with fast.run() as agent:
        # using chain workflow
        await agent.post_writer("http://llmindset.co.uk")
```

All Agents and Workflows respond to `.send("message")` or `.prompt()` to begin a chat session.

Saved as `social.py` we can now run this workflow from the command line with:

```bash
uv run workflow/chaining.py --agent post_writer --message ""
```

Add the `--quiet` switch to disable progress and message display and return only the final response - useful for simple automations.

### MAKER

MAKER (“Massively decomposed Agentic processes with K-voting Error Reduction”) wraps a worker agent and samples it repeatedly until a response achieves a k-vote margin over all alternatives (“first-to-ahead-by-k” voting). This is useful for long chains of simple steps where rare errors would otherwise compound.

- Reference: [Solving a Million-Step LLM Task with Zero Errors](https://arxiv.org/abs/2511.09030)
- Credit: Lucid Programmer (PR author)

```python
@fast.agent(
  name="classifier",
  instruction="Reply with only: A, B, or C.",
)
@fast.maker(
  name="reliable_classifier",
  worker="classifier",
  k=3,
  max_samples=25,
  match_strategy="normalized",
  red_flag_max_length=16,
)
async def main():
  async with fast.run() as agent:
    await agent.reliable_classifier.send("Classify: ...")
```

### Agents As Tools

The Agents As Tools workflow takes a complex task, breaks it into subtasks, and calls other agents as tools based on the main agent instruction.

This pattern is inspired by the OpenAI Agents SDK [Agents as tools](https://openai.github.io/openai-agents-python/tools/#agents-as-tools) feature.

With child agents exposed as tools, you can implement routing, parallelization, and orchestrator-workers [decomposition](https://www.anthropic.com/engineering/building-effective-agents) directly in the instruction (and combine them). Multiple tool calls per turn are supported and executed in parallel.

Common usage patterns may combine:

- Routing: choose the right specialist tool(s) based on the user prompt.
- Parallelization: fan out over independent items/projects, then aggregate.
- Orchestrator-workers: break a task into scoped subtasks (often via a simple JSON plan), then coordinate execution.

```python
@fast.agent(
    name="NY-Project-Manager",
    instruction="Return NY time + timezone, plus a one-line project status.",
    servers=["time"],
)
@fast.agent(
    name="London-Project-Manager",
    instruction="Return London time + timezone, plus a one-line news update.",
    servers=["time"],
)
@fast.agent(
    name="PMO-orchestrator",
    instruction=(
        "Get reports. Always use one tool call per project/news. "  # parallelization
        "Responsibilities: NY projects: [OpenAI, Fast-Agent, Anthropic]. London news: [Economics, Art, Culture]. "  # routing
        "Aggregate results and add a one-line PMO summary."
    ),
    default=True,
    agents=["NY-Project-Manager", "London-Project-Manager"],  # orchestrator-workers
)
async def main() -> None:
    async with fast.run() as agent:
        await agent("Get PMO report. Projects: all. News: Art, Culture")
```

Extended example and all params sample is available in the repository as
[`examples/workflows/agents_as_tools_extended.py`](examples/workflows/agents_as_tools_extended.py).

## MCP OAuth (v2.1)

For SSE and HTTP MCP servers, OAuth is enabled by default with minimal configuration. A local callback server is used to capture the authorization code, with a paste-URL fallback if the port is unavailable.

- Minimal per-server settings in `fast-agent.yaml`:

```yaml
mcp:
  servers:
    myserver:
      transport: http # or sse
      url: http://localhost:8001/mcp # or /sse for SSE servers
      auth:
        oauth: true # default: true
        redirect_port: 3030 # default: 3030
        redirect_path: /callback # default: /callback
        # scope: "user"       # optional; if omitted, server defaults are used
```

- The OAuth client uses PKCE and in-memory token storage (no tokens written to disk).
- Token persistence: by default, tokens are stored securely in your OS keychain via `keyring`. If a keychain is unavailable (e.g., headless container), in-memory storage is used for the session.
- To force in-memory only per server, set:

```yaml
mcp:
  servers:
    myserver:
      transport: http
      url: http://localhost:8001/mcp
      auth:
        oauth: true
        persist: memory
```

- To disable OAuth for a specific server , set `auth.oauth: false` for that server.

## MCP Ping (optional)

The MCP ping utility can be enabled by either peer (client or server). See the [Ping overview](https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/ping#overview).

Client-side pinging is configured per server (default: 30s interval, 3 missed pings):

```yaml
mcp:
  servers:
    myserver:
      ping_interval_seconds: 30 # optional;  str:
    """Translate text to the given language."""
    return f"[{language}] {text}"

@writer.tool(name="summarize", description="Produce a one-line summary")
def summarize(text: str) -> str:
    return f"Summary: {text[:80]}..."
```

**Global tools (`@fast.tool`)** — available to all agents that don't declare their own tools:

```python
@fast.tool
def get_weather(city: str) -> str:
    """Return the current weather for a city."""
    return f"Sunny in {city}"

@fast.agent(name="assistant", instruction="You are helpful.")
# assistant gets get_weather (global @fast.tool)
```

Agents with `@agent.tool` or `function_tools=` only see their own tools — globals are not injected. Use `function_tools=[]` to explicitly opt out of globals with no tools.

### Multimodal Support

Add Resources to prompts using either the inbuilt `prompt-server` or MCP Types directly. Convenience class are made available to do so simply, for example:

```python
  summary: str =  await agent.with_resource(
      "Summarise this PDF please",
      "mcp_server",
      "resource://fast-agent/sample.pdf",
  )
```

#### MCP Tool Result Conversion

LLM APIs have restrictions on the content types that can be returned as Tool Calls/Function results via their Chat Completions API's:

- OpenAI supports Text
- Anthropic supports Text and Image
- Google supports Text, Image, PDF, and Video (e.g., `video/mp4`).
  > **Note**: Inline video data is limited to 20MB. For larger files, use the File API. YouTube URLs are supported directly.

For MCP Tool Results, `ImageResources` and `EmbeddedResources` are converted to User Messages and added to the conversation.

### Prompts

MCP Prompts are supported with `apply_prompt(name,arguments)`, which always returns an Assistant Message. If the last message from the MCP Server is a 'User' message, it is sent to the LLM for processing. Prompts applied to the Agent's Context are retained - meaning that with `use_history=False`, Agents can act as finely tuned responders.

Prompts can also be applied interactively through the interactive interface by using the `/prompt` command.

### Sampling

Sampling LLMs are configured per Client/Server pair. Specify the model name in fast-agent.yaml as follows:

```yaml
mcp:
  servers:
    sampling_resource:
      command: "uv"
      args: ["run", "sampling_resource_server.py"]
      sampling:
        model: "haiku"
```

### Secrets File

> [!TIP]
> Put `fast-agent.secrets.yaml` alongside `fast-agent.yaml` in your active fast-agent home. Select a different home with `--env` or `FAST_AGENT_HOME`.

### Interactive Shell

## Documentation

The documentation site lives in `docs/`. To work with the docs locally:

```bash
# Install docs dependencies (first time only)
uv run scripts/docs.py install

# Generate reference docs from source code
uv run scripts/docs.py generate

# Run the dev server (http://127.0.0.1:8000)
uv run scripts/docs.py serve

# Capture and assess screenshots of the built docs
uv run scripts/docs.py screenshot
uv run scripts/docs.py assess

# Or generate and serve in one command
uv run scripts/docs.py all
```

The generator extracts configuration field descriptions,

…

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [evalstate](https://github.com/evalstate)
- **Source:** [evalstate/fast-agent](https://github.com/evalstate/fast-agent)
- **License:** Apache-2.0
- **Homepage:** https://fast-agent.ai

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-evalstate-fast-agent
- Seller: https://agentstack.voostack.com/s/evalstate
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
