MCP (Model Context Protocol)
Table of contents
What is MCP?
The Model Context Protocol (MCP) is an open standard developed by Anthropic that defines how applications share context with large language models (LLMs).
MCP extends the capabilities of apps like Claude Desktop, Cursor, or GitHub Copilot by feeding them OpenAPI schemas that describe tools or services, like Replicateās HTTP API.
MCP lets you give natural language instructions to a language model, and it can discover and run APIs automatically on your behalf.
Here are some examples of the kinds of prompts you can use:
Search Replicate for upscaler models and compare them
Show me the latest Replicate models created by @fofr
Generate an image using black-forest-labs/flux-schnell
Upscale that image using the best upscaler model
Replicateās MCP server
Replicateās MCP server is published as an npm package that is automatically updated whenever we add new features to Replicateās HTTP API:
š¦ npm.im/replicate-mcp
The server supports all of the operations in Replicateās HTTP API. Once youāve got it wired up you can use natural language chat to do things like:
- Search for models (using
models.search
under the hood) - Compare models (using
models.list
under the hood) - Fetch model metadata (using
models.get
under the hood) - Run models (using
predictions.create
under the hood) - Fetch predictions (using
predictions.get
under the hood) - etcā¦
Running the MCP server
The replicate-mcp
npm package is a self-contained HTTP server that you can run using the Node.js npx
command, which downloads and executes npm packages by name without you having to install them first.
Use this command to start the MCP server:
npx -y replicate-mcp
āļø This command will fire up a local HTTP server, but in practice you wonāt usually run it this way. Instead, youāll add some JSON configuration to your Claude, Cursor, or VS Code settings that will quietly and automatically run these local MCP servers on your machine.
Stop your server by pressing Ctrl+c
in the terminal:
^c
Then read on to learn how to configure your apps to run the MCP server automatically.
Using Replicate MCP with Claude Desktop
Claude Desktop supports local MCP servers out of the box. Note that this only works with the Claude desktop app, not the web app.
Hereās how to set it up:
-
Create a Replicate API token and copy it.
-
Open Claude Desktop.
-
Click the Claude menu and select Settings⦠(not the in-app account settings).
-
In the Settings window, click Developer in the sidebar, then click Edit Config. This will open (or create) a
claude_desktop_config.json
file. -
Add the following JSON to the file, substituting your Replicate API token for
your-token-here
:{ "mcpServers": { "replicate": { "command": "npx", "args": ["-y", "replicate-mcp"], "env": { "REPLICATE_API_TOKEN": "your-token-here" } } } }
-
Restart Claude Desktop. Click the Search and Tools icon in the input box. You should see
replicate
listed as a tool:

Now that youāve got the MCP server running, you can use it to search for models, run predictions, and fetch model metadata.
Try these prompts in Claude Desktop:
Search Replicate for upscaler models and compare them
Show me the latest Replicate models created by @fofr
Generate an image using black-forest-labs/flux-schnell
Upscale that image using the best upscaler model

Using Replicate MCP with Cursor
Cursor supports the Model Context Protocol (MCP), allowing you to connect external tools and data sourcesālike Replicateās HTTP APIādirectly to your code editor. With Replicateās MCP server, you can search for models, run predictions, and fetch model metadata from within Cursor using natural language.
Hereās how to set it up:
-
Create a Replicate API token and copy it.
-
In your project, create a
.cursor/mcp.json
file with the following content:{ "mcpServers": { "replicate": { "command": "npx", "args": ["-y", "replicate-mcp"], "env": { "REPLICATE_API_TOKEN": "your-token-here" } } } }
Replace
your-token-here
with your Replicate API token. -
Open Cursor. The MCP server will be started automatically when you use a tool that requires it, or you can start it manually from the MCP settings page.
-
In Cursor, open the MCP settings (search for āMCPā in the command palette or find it in the settings sidebar). You should see
replicate
listed as an available tool.

Now you can use Replicate tools in Cursorās Composer Agent:
Search Replicate for upscaler models and compare them
Generate an image using black-forest-labs/flux-schnell
Upscale that image using the best upscaler model
You can also configure MCP servers globally by creating a ~/.cursor/mcp.json
file, making Replicateās tools available in all your Cursor workspaces.
For more details, see the Cursor MCP documentation.
Using Replicate MCP with GitHub Copilot in VS Code
You can use Replicateās MCP server with GitHub Copilot Chat in Visual Studio Code to access Replicateās API tools directly from chat. To set it up:
-
Install Visual Studio Code version 1.99 or later and make sure you have access to Copilot Chat.
-
Create a Replicate API token and copy it.
-
In your project, create a
.vscode/mcp.json
file with the following content:{ "servers": { "replicate": { "command": "npx", "args": ["-y", "replicate-mcp"], "env": { "REPLICATE_API_TOKEN": "your-token-here" } } } }
Replace
your-token-here
with your Replicate API token. -
Open the
.vscode/mcp.json
file in VS Code and click the Start button that appears to launch the MCP server. -
Open Copilot Chat, select Agent from the chat menu, and use Replicate tools in natural language (e.g., āSearch Replicate for upscaler modelsā).
You can also configure the MCP server to run globally in VS Code by adding the configuration to your user settings.json
. For instructions, see the GitHub Copilot documentation on using existing MCP configurations.
For more details and advanced configuration, see the official GitHub Copilot documentation.