This MCP server implementation works with the FLUX API and Replicate. It allows you to connect your local Obsidian or other Markdown apps to AI services through the Model Context Protocol (MCP), letting you interact with AI models directly from your preferred writing environment.
git clone https://github.com/username/mcp-replicate-flux.git
cd mcp-replicate-flux
npm install
# or
yarn install
.env
file in the root directory with your API keys:REPLICATE_API_TOKEN=your_replicate_api_key_here
FLUX_API_KEY=your_flux_api_key_here
npm start
# or
yarn start
Once your server is running, it will be available at http://localhost:3000
by default. You can connect to it from any MCP-compatible client.
You can configure the server by modifying the following environment variables in your .env
file:
PORT=3000 # Change the port number if needed
LOG_LEVEL=info # Options: debug, info, warn, error
REPLICATE_API_TOKEN=your_key # Your Replicate API key
FLUX_API_KEY=your_key # Your FLUX API key
http://localhost:3000
To generate text using your MCP server in a compatible client, you can use commands like:
/generate a short story about a space explorer
If you encounter connection issues:
http://localhost:3000/status
in your browser.env
fileYou can specify which model to use by adding a model parameter:
/generate with:meta/llama-3-8b-instruct a technical explanation of quantum computing
Control the output by modifying these parameters:
Example with parameters:
/generate temperature:0.7 max_length:500 a creative marketing slogan
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "replicate-flux" '{"command":"npx","args":["-y","mcp-replicate-flux"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"replicate-flux": {
"command": "npx",
"args": [
"-y",
"mcp-replicate-flux"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"replicate-flux": {
"command": "npx",
"args": [
"-y",
"mcp-replicate-flux"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect