Skip to content

Commit bafceff

Browse files
committed
docs: split MCP servers guide into server and proxy sections
1 parent 94ea736 commit bafceff

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

docs/03_guides/14_mcp_servers.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ Apify Actors are a good fit for MCP servers:
2323

2424
There are two ways to build one, and Apify maintains a template for each:
2525

26-
- Write a server from scratch with [FastMCP](https://gofastmcp.com/), starting from the [`python-mcp-empty`](https://apify.com/templates/python-mcp-empty) template.
27-
- Wrap an existing MCP server (stdio, HTTP, or SSE) behind a gateway, starting from the [`python-mcp-proxy`](https://apify.com/templates/python-mcp-proxy) template.
26+
- Write a server from scratch with [FastMCP](https://gofastmcp.com/), starting from the [`python-mcp-empty`](https://apify.com/templates/python-mcp-empty) template. See [MCP server](#mcp-server) below.
27+
- Wrap an existing MCP server (stdio, HTTP, or SSE) behind a gateway, starting from the [`python-mcp-proxy`](https://apify.com/templates/python-mcp-proxy) template. See [MCP proxy](#mcp-proxy) below.
2828

2929
Both templates live in the [actor-templates repository](https://github.com/apify/actor-templates) and can be scaffolded with the [Apify CLI](https://docs.apify.com/cli), for example `apify create my-mcp-server --template python-mcp-empty`.
3030

31-
## Example MCP server
31+
## MCP server
3232

33-
The following Actor runs a small [FastMCP](https://gofastmcp.com/) server that exposes a single `add` tool and an informational resource. It serves the MCP protocol over the [Streamable HTTP](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#streamable-http) transport on the Actor's web server port:
33+
Build your own server when you want to expose your own tools and resources. The following Actor runs a small [FastMCP](https://gofastmcp.com/) server that exposes a single `add` tool and an informational resource. It serves the MCP protocol over the [Streamable HTTP](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#streamable-http) transport on the Actor's web server port:
3434

3535
<RunnableCodeBlock className="language-python" language="python">
3636
{McpServerExample}
@@ -43,7 +43,7 @@ Note that:
4343
- The server binds to `Actor.configuration.web_server_port` and `0.0.0.0`, so the platform can route the Actor's container URL to it. This is the same mechanism described in the [Running a web server](./running-webserver) guide.
4444
- The server keeps running until the platform shuts the Actor down. With Standby, that happens automatically once an instance has been idle for a while.
4545

46-
## Exposing it over Standby
46+
### Exposing it over Standby
4747

4848
To make the server an always-ready HTTP API, enable [Actor Standby](https://docs.apify.com/platform/actors/development/programming-interface/standby) and tell the platform where the MCP endpoint lives. Set both in the Actor's `.actor/actor.json`:
4949

@@ -71,7 +71,7 @@ Once deployed, an MCP client connects to the Actor's URL using the Streamable HT
7171
}
7272
```
7373

74-
## Wrapping an existing MCP server
74+
## MCP proxy
7575

7676
If you already have an MCP server (or want to expose a third-party one), you don't need to rewrite it. The [`python-mcp-proxy`](https://apify.com/templates/python-mcp-proxy) template runs a gateway that connects to an existing server and re-exposes it over Streamable HTTP, while adding Apify's charging and tool authorization on top.
7777

@@ -95,7 +95,7 @@ server_type = ServerType.HTTP # or ServerType.SSE
9595
MCP_SERVER_PARAMS = RemoteServerParameters(url='https://mcp.apify.com')
9696
```
9797

98-
On top of forwarding requests, the gateway gives you a `TOOL_WHITELIST` to control which tools clients may call, and a hook to charge for each MCP operation. For details, see the template's README.
98+
On top of forwarding requests, the gateway gives you a `TOOL_WHITELIST` to control which tools clients may call, and a hook to charge for each MCP operation. Like a server you build yourself, the proxy runs over [Actor Standby](#exposing-it-over-standby) and clients connect to it the same way. For details, see the template's README.
9999

100100
## Monetizing with pay-per-event
101101

0 commit comments

Comments
 (0)