Spaces:
Running
Running
Jeremiah Lowin commited on
Commit ·
5a6606b
1
Parent(s): bc74b3b
Minor docs updates
Browse files
docs/integrations/anthropic.mdx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
---
|
| 2 |
-
title: Anthropic
|
| 3 |
-
sidebarTitle: Anthropic
|
| 4 |
description: Call FastMCP servers from the Anthropic API
|
| 5 |
icon: message-smile
|
| 6 |
tag: "New!"
|
|
@@ -8,9 +8,6 @@ tag: "New!"
|
|
| 8 |
|
| 9 |
import { VersionBadge } from "/snippets/version-badge.mdx"
|
| 10 |
|
| 11 |
-
Anthropic supports MCP servers through the [MCP connector](https://docs.anthropic.com/en/docs/agents-and-tools/mcp-connector) feature in the Messages API, allowing you to extend AI capabilities with custom tools from remote MCP servers.
|
| 12 |
-
|
| 13 |
-
## Messages API
|
| 14 |
|
| 15 |
Anthropic's [Messages API](https://docs.anthropic.com/en/api/messages) supports MCP servers as remote tool sources. This tutorial will show you how to create a FastMCP server and deploy it to a public URL, then how to call it from the Messages API.
|
| 16 |
|
|
@@ -18,7 +15,7 @@ Anthropic's [Messages API](https://docs.anthropic.com/en/api/messages) supports
|
|
| 18 |
Currently, the MCP connector only accesses **tools** from MCP servers—it queries the `list_tools` endpoint and exposes those functions to Claude. Other MCP features like resources and prompts are not currently supported. You can read more about the MCP connector in the [Anthropic documentation](https://docs.anthropic.com/en/docs/agents-and-tools/mcp-connector).
|
| 19 |
</Tip>
|
| 20 |
|
| 21 |
-
##
|
| 22 |
|
| 23 |
First, create a FastMCP server with the tools you want to expose. For this example, we'll create a server with a single tool that rolls dice.
|
| 24 |
|
|
@@ -37,7 +34,7 @@ if __name__ == "__main__":
|
|
| 37 |
mcp.run(transport="sse", port=8000)
|
| 38 |
```
|
| 39 |
|
| 40 |
-
##
|
| 41 |
|
| 42 |
Your server must be deployed to a public URL in order for Anthropic to access it. The MCP connector supports both SSE and Streamable HTTP transports.
|
| 43 |
|
|
@@ -59,7 +56,7 @@ ngrok http 8000
|
|
| 59 |
This exposes your unauthenticated server to the internet. Only run this command in a safe environment if you understand the risks.
|
| 60 |
</Warning>
|
| 61 |
|
| 62 |
-
##
|
| 63 |
|
| 64 |
To use the Messages API with MCP servers, you'll need to install the Anthropic Python SDK (not included with FastMCP):
|
| 65 |
|
|
@@ -114,13 +111,13 @@ The results were 4, 2, and 6. Would you like me to roll again or roll a differen
|
|
| 114 |
```
|
| 115 |
|
| 116 |
|
| 117 |
-
##
|
| 118 |
|
| 119 |
<VersionBadge version="2.6.0" />
|
| 120 |
|
| 121 |
The MCP connector supports OAuth authentication through authorization tokens, which means you can secure your server while still allowing Anthropic to access it.
|
| 122 |
|
| 123 |
-
###
|
| 124 |
|
| 125 |
The simplest way to add authentication to the server is to use a bearer token scheme.
|
| 126 |
|
|
@@ -181,7 +178,7 @@ if __name__ == "__main__":
|
|
| 181 |
mcp.run(transport="sse", port=8000)
|
| 182 |
```
|
| 183 |
|
| 184 |
-
###
|
| 185 |
|
| 186 |
If you try to call the authenticated server with the same Anthropic code we wrote earlier, you'll get an error indicating that the server rejected the request because it's not authenticated.
|
| 187 |
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Anthropic API + FastMCP
|
| 3 |
+
sidebarTitle: Anthropic API
|
| 4 |
description: Call FastMCP servers from the Anthropic API
|
| 5 |
icon: message-smile
|
| 6 |
tag: "New!"
|
|
|
|
| 8 |
|
| 9 |
import { VersionBadge } from "/snippets/version-badge.mdx"
|
| 10 |
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
Anthropic's [Messages API](https://docs.anthropic.com/en/api/messages) supports MCP servers as remote tool sources. This tutorial will show you how to create a FastMCP server and deploy it to a public URL, then how to call it from the Messages API.
|
| 13 |
|
|
|
|
| 15 |
Currently, the MCP connector only accesses **tools** from MCP servers—it queries the `list_tools` endpoint and exposes those functions to Claude. Other MCP features like resources and prompts are not currently supported. You can read more about the MCP connector in the [Anthropic documentation](https://docs.anthropic.com/en/docs/agents-and-tools/mcp-connector).
|
| 16 |
</Tip>
|
| 17 |
|
| 18 |
+
## Create a Server
|
| 19 |
|
| 20 |
First, create a FastMCP server with the tools you want to expose. For this example, we'll create a server with a single tool that rolls dice.
|
| 21 |
|
|
|
|
| 34 |
mcp.run(transport="sse", port=8000)
|
| 35 |
```
|
| 36 |
|
| 37 |
+
## Deploy the Server
|
| 38 |
|
| 39 |
Your server must be deployed to a public URL in order for Anthropic to access it. The MCP connector supports both SSE and Streamable HTTP transports.
|
| 40 |
|
|
|
|
| 56 |
This exposes your unauthenticated server to the internet. Only run this command in a safe environment if you understand the risks.
|
| 57 |
</Warning>
|
| 58 |
|
| 59 |
+
## Call the Server
|
| 60 |
|
| 61 |
To use the Messages API with MCP servers, you'll need to install the Anthropic Python SDK (not included with FastMCP):
|
| 62 |
|
|
|
|
| 111 |
```
|
| 112 |
|
| 113 |
|
| 114 |
+
## Authentication
|
| 115 |
|
| 116 |
<VersionBadge version="2.6.0" />
|
| 117 |
|
| 118 |
The MCP connector supports OAuth authentication through authorization tokens, which means you can secure your server while still allowing Anthropic to access it.
|
| 119 |
|
| 120 |
+
### Server Authentication
|
| 121 |
|
| 122 |
The simplest way to add authentication to the server is to use a bearer token scheme.
|
| 123 |
|
|
|
|
| 178 |
mcp.run(transport="sse", port=8000)
|
| 179 |
```
|
| 180 |
|
| 181 |
+
### Client Authentication
|
| 182 |
|
| 183 |
If you try to call the authenticated server with the same Anthropic code we wrote earlier, you'll get an error indicating that the server rejected the request because it's not authenticated.
|
| 184 |
|
docs/integrations/claude-desktop.mdx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
title: Claude Desktop
|
| 3 |
sidebarTitle: Claude Desktop
|
| 4 |
description: Call FastMCP servers from Claude Desktop
|
| 5 |
icon: desktop
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Claude Desktop + FastMCP
|
| 3 |
sidebarTitle: Claude Desktop
|
| 4 |
description: Call FastMCP servers from Claude Desktop
|
| 5 |
icon: desktop
|
docs/integrations/gemini.mdx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
title: Gemini SDK
|
| 3 |
sidebarTitle: Gemini SDK
|
| 4 |
description: Call FastMCP servers from the Google Gemini SDK
|
| 5 |
icon: message-smile
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Gemini SDK + FastMCP
|
| 3 |
sidebarTitle: Gemini SDK
|
| 4 |
description: Call FastMCP servers from the Google Gemini SDK
|
| 5 |
icon: message-smile
|
docs/integrations/openai.mdx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
---
|
| 2 |
-
title: OpenAI
|
| 3 |
-
sidebarTitle: OpenAI
|
| 4 |
description: Call FastMCP servers from the OpenAI API
|
| 5 |
icon: message-smile
|
| 6 |
tag: "New!"
|
|
@@ -8,14 +8,13 @@ tag: "New!"
|
|
| 8 |
|
| 9 |
import { VersionBadge } from "/snippets/version-badge.mdx"
|
| 10 |
|
| 11 |
-
OpenAI recently announced support for MCP servers in the Responses API. Note that at this time, MCP is not supported in ChatGPT.
|
| 12 |
|
| 13 |
## Responses API
|
| 14 |
|
| 15 |
OpenAI's [Responses API](https://platform.openai.com/docs/api-reference/responses) supports [MCP servers](https://platform.openai.com/docs/guides/tools-remote-mcp) as remote tool sources, allowing you to extend AI capabilities with custom functions.
|
| 16 |
|
| 17 |
<Note>
|
| 18 |
-
The Responses API is a distinct API from OpenAI's Completions API
|
| 19 |
</Note>
|
| 20 |
|
| 21 |
<Tip>
|
|
|
|
| 1 |
---
|
| 2 |
+
title: OpenAI API + FastMCP
|
| 3 |
+
sidebarTitle: OpenAI API
|
| 4 |
description: Call FastMCP servers from the OpenAI API
|
| 5 |
icon: message-smile
|
| 6 |
tag: "New!"
|
|
|
|
| 8 |
|
| 9 |
import { VersionBadge } from "/snippets/version-badge.mdx"
|
| 10 |
|
|
|
|
| 11 |
|
| 12 |
## Responses API
|
| 13 |
|
| 14 |
OpenAI's [Responses API](https://platform.openai.com/docs/api-reference/responses) supports [MCP servers](https://platform.openai.com/docs/guides/tools-remote-mcp) as remote tool sources, allowing you to extend AI capabilities with custom functions.
|
| 15 |
|
| 16 |
<Note>
|
| 17 |
+
The Responses API is a distinct API from OpenAI's Completions API or Assistants API. At this time, only the Responses API supports MCP.
|
| 18 |
</Note>
|
| 19 |
|
| 20 |
<Tip>
|