A high-performance HTTP/2-enabled proxy server designed specifically to enable Cursor IDE's Composer to use DeepSeek's, OpenRouter's and Ollama's language models. This proxy translates OpenAI-compatible API requests to DeepSeek/OpenRouter/Ollama API format, allowing Cursor's Composer and other OpenAI API-compatible tools to seamlessly work with these models.
This proxy was created to enable Cursor IDE users to leverage DeepSeek's, OpenRouter's and Ollama's powerful language models through Cursor's Composer interface as an alternative to OpenAI's models. By running this proxy locally, you can configure Cursor's Composer to use these models for AI assistance, code generation, and other AI features. It handles all the necessary request/response translations and format conversions to make the integration seamless.
go mod download
The proxy supports both DeepSeek and OpenRouter variants. Choose the appropriate build command for your needs:
bash
docker build -t cursor-deepseek .bash
docker build -t cursor-openrouter --build-arg PROXY_VARIANT=openrouter .For Ollama:
bash
docker build -t cursor-ollama --build-arg PROXY_VARIANT=ollama .
Configure environment variables:
bash
cp .env.example .envEdit .env and add your API key (either DeepSeek or OpenRouter)
Run the container:
docker run -p 9000:9000 --env-file .env cursor-deepseek
# OR for OpenRouter
docker run -p 9000:9000 --env-file .env cursor-openrouter
# OR for Ollama
docker run -p 9000:9000 --env-file .env cursor-ollama
The repository includes an .env.example file showing the required environment variables. To configure:
cp .env.example .env
.env and add your API key:# For DeepSeek
DEEPSEEK_API_KEY=your_deepseek_api_key_here
# OR for OpenRouter
OPENROUTER_API_KEY=your_openrouter_api_key_here
# OR for Ollama
OLLAMA_API_KEY=your_ollama_api_key_here
Note: Only configure ONE of the API keys based on which variant you're using.
go run proxy.go
# OR you can specify a model:
go run proxy.go -model coder
# OR
go run proxy.go -model chat
# OR for OpenRouter
go run proxy-openrouter.go
# OR for Ollama
go run proxy-ollama.go
The server will start on port 9000 by default.
http://your-public-endpoint:9000/v1You can expose your local proxy server to the internet using ngrok or similar services. This is useful when you need to access the proxy from external applications or different networks.
Install ngrok from https://ngrok.com/download
Start your proxy server locally (it will run on port 9000)
In a new terminal, run ngrok:
ngrok http 9000
ngrok will provide you with a public URL (e.g., https://your-unique-id.ngrok.io)
Use this URL as your OpenAI API base URL in Cursor's settings:
https://your-unique-id.ngrok.io/v1
You can also use other services to expose your endpoint:
Run: cloudflared tunnel --url http://localhost:9000
LocalTunnel:
npm install -g localtunnellt --port 9000Remember to always secure your endpoint appropriately when exposing it to the internet.
/v1/chat/completions - Chat completions endpoint/v1/models - Models listing endpointgpt-4o maps to DeepSeek's GPT-4o equivalent modeldeepseek-chat for DeepSeek's native chat modeldeepseek/deepseek-chat for OpenRouter's DeepSeek modelgithub.com/andybalholm/brotli - Brotli compression supportgithub.com/joho/godotenv - Environment variable managementgolang.org/x/net - HTTP/2 supportThis project is licensed under the GNU General Public License v2.0 (GPLv2). See the LICENSE.md file for details.
$ claude mcp add cursor-deepseek \
-- python -m otcore.mcp_server <graph>