Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@
"integrations/claude-desktop",
"integrations/cursor",
"integrations/gemini-cli",
"integrations/goose",
"integrations/mcp-json-configuration"
]
},
Expand Down Expand Up @@ -307,6 +308,7 @@
"python-sdk/fastmcp-cli-install-claude_desktop",
"python-sdk/fastmcp-cli-install-cursor",
"python-sdk/fastmcp-cli-install-gemini_cli",
"python-sdk/fastmcp-cli-install-goose",
"python-sdk/fastmcp-cli-install-mcp_json",
"python-sdk/fastmcp-cli-install-shared"
]
Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/chatgpt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Connect FastMCP servers to ChatGPT in Chat and Deep Research modes
icon: message-smile
---

ChatGPT supports MCP servers through remote HTTP connections in two modes: **Chat mode** for interactive conversations and **Deep Research mode** for comprehensive information retrieval.
[ChatGPT](https://chatgpt.com/) supports MCP servers through remote HTTP connections in two modes: **Chat mode** for interactive conversations and **Deep Research mode** for comprehensive information retrieval.

<Tip>
**Developer Mode Required for Chat Mode**: To use MCP servers in regular ChatGPT conversations, you must first enable Developer Mode in your ChatGPT settings. This feature is available for ChatGPT Pro, Team, Enterprise, and Edu users.
Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/claude-code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { LocalFocusTip } from "/snippets/local-focus.mdx"

<LocalFocusTip />

Claude Code supports MCP servers through multiple transport methods including STDIO, SSE, and HTTP, allowing you to extend Claude's capabilities with custom tools, resources, and prompts from your FastMCP servers.
[Claude Code](https://docs.anthropic.com/en/docs/claude-code) supports MCP servers through multiple transport methods including STDIO, SSE, and HTTP, allowing you to extend Claude's capabilities with custom tools, resources, and prompts from your FastMCP servers.

## Requirements

Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/claude-desktop.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { LocalFocusTip } from "/snippets/local-focus.mdx"

<LocalFocusTip />

Claude Desktop supports MCP servers through local STDIO connections and remote servers (beta), allowing you to extend Claude's capabilities with custom tools, resources, and prompts from your FastMCP servers.
[Claude Desktop](https://www.claude.com/download) supports MCP servers through local STDIO connections and remote servers (beta), allowing you to extend Claude's capabilities with custom tools, resources, and prompts from your FastMCP servers.

<Note>
Remote MCP server support is currently in beta and available for users on Claude Pro, Max, Team, and Enterprise plans (as of June 2025). Most users will still need to use local STDIO connections.
Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/cursor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { LocalFocusTip } from "/snippets/local-focus.mdx"

<LocalFocusTip />

Cursor supports MCP servers through multiple transport methods including STDIO, SSE, and Streamable HTTP, allowing you to extend Cursor's AI assistant with custom tools, resources, and prompts from your FastMCP servers.
[Cursor](https://www.cursor.com/) supports MCP servers through multiple transport methods including STDIO, SSE, and Streamable HTTP, allowing you to extend Cursor's AI assistant with custom tools, resources, and prompts from your FastMCP servers.

## Requirements

Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/gemini-cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { LocalFocusTip } from "/snippets/local-focus.mdx"

<LocalFocusTip />

Gemini CLI supports MCP servers through multiple transport methods including STDIO, SSE, and HTTP, allowing you to extend Gemini's capabilities with custom tools, resources, and prompts from your FastMCP servers.
[Gemini CLI](https://geminicli.com/) supports MCP servers through multiple transport methods including STDIO, SSE, and HTTP, allowing you to extend Gemini's capabilities with custom tools, resources, and prompts from your FastMCP servers.

## Requirements

Expand Down
178 changes: 178 additions & 0 deletions docs/integrations/goose.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
---
title: Goose 🤝 FastMCP
sidebarTitle: Goose
description: Install and use FastMCP servers in Goose
icon: message-smile
---

import { VersionBadge } from "/snippets/version-badge.mdx"
import { LocalFocusTip } from "/snippets/local-focus.mdx"

<LocalFocusTip />

[Goose](https://block.github.io/goose/) is an open-source AI agent from Block that supports MCP servers as extensions. FastMCP can install your server directly into Goose using its deeplink protocol — one command opens Goose with an install dialog ready to go.

## Requirements

This integration uses Goose's deeplink protocol to register your server as a STDIO extension running via `uvx`. You must have Goose installed on your system for the deeplink to open automatically.

For remote deployments, configure your FastMCP server with HTTP transport and add it to Goose directly using `goose configure` or the config file.

## Create a Server

The examples in this guide will use the following simple dice-rolling server, saved as `server.py`.

```python server.py
import random
from fastmcp import FastMCP

mcp = FastMCP(name="Dice Roller")

@mcp.tool
def roll_dice(n_dice: int) -> list[int]:
"""Roll `n_dice` 6-sided dice and return the results."""
return [random.randint(1, 6) for _ in range(n_dice)]

if __name__ == "__main__":
mcp.run()
```

## Install the Server

### FastMCP CLI
<VersionBadge version="3.0.0" />

The easiest way to install a FastMCP server in Goose is using the `fastmcp install goose` command. This generates a `goose://` deeplink and opens it, prompting Goose to install the server.

```bash
fastmcp install goose server.py
```

The install command supports the same `file.py:object` notation as the `run` command. If no object is specified, it will automatically look for a FastMCP server object named `mcp`, `server`, or `app` in your file:

```bash
# These are equivalent if your server object is named 'mcp'
fastmcp install goose server.py
fastmcp install goose server.py:mcp

# Use explicit object name if your server has a different name
fastmcp install goose server.py:my_custom_server
```

Under the hood, the generated command uses `uvx` to run your server in an isolated environment. Goose requires `uvx` rather than `uv run`, so the install produces a command like:

```bash
uvx --with pandas fastmcp run /path/to/server.py
```

#### Dependencies

Use the `--with` flag to specify additional packages your server needs:

```bash
fastmcp install goose server.py --with pandas --with requests
```

Alternatively, you can use a `fastmcp.json` configuration file (recommended):

```json fastmcp.json
{
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
"source": {
"path": "server.py",
"entrypoint": "mcp"
},
"environment": {
"dependencies": ["pandas", "requests"]
}
}
```

#### Python Version

Use `--python` to specify which Python version your server should use:

```bash
fastmcp install goose server.py --python 3.11
```

<Note>
The Goose install uses `uvx`, which does not support `--project`, `--with-requirements`, or `--with-editable`. If you need these options, use `fastmcp install mcp-json` to generate a full configuration and add it to Goose manually.
</Note>

#### Environment Variables

Goose's deeplink protocol does not support environment variables. If your server needs them (like API keys), you have two options:

1. **Configure after install**: Run `goose configure` and add environment variables to the extension.
2. **Manual config**: Use `fastmcp install mcp-json` to generate the full configuration, then add it to `~/.config/goose/config.yaml` with the `envs` field.

Comment thread
jlowin marked this conversation as resolved.
### Manual Configuration

For more control, you can manually edit Goose's configuration file at `~/.config/goose/config.yaml`:

```yaml
extensions:
dice-roller:
name: Dice Roller
cmd: uvx
args: [fastmcp, run, /path/to/server.py]
enabled: true
type: stdio
timeout: 300
```

#### Dependencies

When manually configuring, add packages using `--with` flags in the args:

```yaml
extensions:
dice-roller:
name: Dice Roller
cmd: uvx
args: [--with, pandas, --with, requests, fastmcp, run, /path/to/server.py]
enabled: true
type: stdio
timeout: 300
```

#### Environment Variables

Environment variables can be specified in the `envs` field:

```yaml
extensions:
weather-server:
name: Weather Server
cmd: uvx
args: [fastmcp, run, /path/to/weather_server.py]
enabled: true
envs:
API_KEY: your-api-key
DEBUG: "true"
type: stdio
timeout: 300
```

You can also use `goose configure` to add extensions interactively, which prompts for environment variables.

<Warning>
**`uvx` (from `uv`) must be installed and available in your system PATH**. Goose uses `uvx` to run Python-based extensions in isolated environments.
</Warning>

## Using the Server

Once your server is installed, you can start using your FastMCP server with Goose.

Try asking Goose something like:

> "Roll some dice for me"

Goose will automatically detect your `roll_dice` tool and use it to fulfill your request, returning something like:

> 🎲 Here are your dice rolls: 4, 6, 4
>
> You rolled 3 dice with a total of 14!

Goose can now access all the tools, resources, and prompts you've defined in your FastMCP server.
5 changes: 5 additions & 0 deletions docs/patterns/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ Install a MCP server in MCP client applications. FastMCP currently supports the
- **Claude Desktop** - Installs via direct configuration file modification
- **Cursor** - Installs via deeplink that opens Cursor for user confirmation
- **Gemini CLI** - Installs via Gemini CLI's built-in MCP management system
- **Goose** - Installs via deeplink that opens Goose for user confirmation (uses `uvx`)
- **MCP JSON** - Generates standard MCP JSON configuration for manual use
- **Stdio** - Outputs the shell command to run a server over stdio transport

Expand All @@ -309,6 +310,7 @@ fastmcp install claude-code server.py
fastmcp install claude-desktop server.py
fastmcp install cursor server.py
fastmcp install gemini-cli server.py
fastmcp install goose server.py
fastmcp install mcp-json server.py
fastmcp install stdio server.py
```
Expand Down Expand Up @@ -384,6 +386,9 @@ fastmcp install cursor server.py --env API_KEY=secret --env DEBUG=true
# Install with environment file
fastmcp install cursor server.py --env-file .env

# Install in Goose (uses uvx deeplink)
fastmcp install goose server.py --with pandas

# Install with specific Python version
fastmcp install claude-desktop server.py --python 3.11

Expand Down
2 changes: 2 additions & 0 deletions src/fastmcp/cli/install/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from .claude_desktop import claude_desktop_command
from .cursor import cursor_command
from .gemini_cli import gemini_cli_command
from .goose import goose_command
from .mcp_json import mcp_json_command
from .stdio import stdio_command

Expand All @@ -20,5 +21,6 @@
install_app.command(claude_desktop_command, name="claude-desktop")
install_app.command(cursor_command, name="cursor")
install_app.command(gemini_cli_command, name="gemini-cli")
install_app.command(goose_command, name="goose")
install_app.command(mcp_json_command, name="mcp-json")
install_app.command(stdio_command, name="stdio")
23 changes: 4 additions & 19 deletions src/fastmcp/cli/install/cursor.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
"""Cursor integration for FastMCP install using Cyclopts."""

import base64
import os
import subprocess
import sys
from pathlib import Path
from typing import Annotated
from urllib.parse import quote, urlparse
from urllib.parse import quote

import cyclopts
from rich import print
Expand All @@ -15,6 +13,7 @@
from fastmcp.utilities.logging import get_logger
from fastmcp.utilities.mcp_server_config.v1.environments.uv import UVEnvironment

from .shared import open_deeplink as _shared_open_deeplink
from .shared import process_common_args

logger = get_logger(__name__)
Expand Down Expand Up @@ -46,29 +45,15 @@ def generate_cursor_deeplink(


def open_deeplink(deeplink: str) -> bool:
"""Attempt to open a deeplink URL using the system's default handler.
"""Attempt to open a Cursor deeplink URL using the system's default handler.

Args:
deeplink: The deeplink URL to open

Returns:
True if the command succeeded, False otherwise
"""
parsed = urlparse(deeplink)
if parsed.scheme != "cursor":
logger.warning(f"Invalid deeplink scheme: {parsed.scheme}")
return False

try:
if sys.platform == "darwin": # macOS
subprocess.run(["open", deeplink], check=True, capture_output=True)
elif sys.platform == "win32": # Windows
os.startfile(deeplink)
else: # Linux and others
subprocess.run(["xdg-open", deeplink], check=True, capture_output=True)
return True
except (subprocess.CalledProcessError, FileNotFoundError, OSError):
return False
return _shared_open_deeplink(deeplink, expected_scheme="cursor")


def install_cursor_workspace(
Expand Down
Loading