docs/03-special-guides/serena_on_chatgpt.md
This guide explains how to expose a locally running Serena MCP server (powered by MCPO) to the internet using Cloudflare Tunnel, and how to connect it to ChatGPT as a Custom GPT with tool access.
Once configured, ChatGPT becomes a powerful coding agent with direct access to your codebase, shell, and file system — so read the security notes carefully.
Make sure you have uv and cloudflared installed.
Run the following command to launch Serena as http server (assuming port 8000):
uvx mcpo --port 8000 --api-key <YOUR_SECRET_KEY> -- \
uvx --from git+https://github.com/oraios/serena \
serena start-mcp-server --context chatgpt --project $(pwd)
--api-key is required to secure the server.--project should point to the root of your codebase.You can also use other options, and you don't have to pass --project if you want to work on multiple projects
or want to activate it later. See
uvx --from git+https://github.com/oraios/serena serena start-mcp-server --help
Run:
cloudflared tunnel --url http://localhost:8000
This will give you a public HTTPS URL like:
https://serena-agent-tunnel.trycloudflare.com
Your server is now securely exposed to the internet.
<cloudflared_url>/openapi.json with the URL you got from the previous step. "servers": ["url": "<cloudflared_url>"],
ChatGPT will read the schema and create functions automatically.
Depending on your configuration and enabled tools, Serena's MCP server may:
This gives ChatGPT the same powers as a remote developer on your machine.
In your project’s .serena/project.yml or global config, you can disable tools like:
excluded_tools:
- execute_shell_command
- ...
read_only: true
This is strongly recommended if you want a read-only or safer agent.
With this setup, ChatGPT becomes a coding assistant running on your local code — able to index, search, edit, and even run shell commands depending on your configuration.
Use responsibly, and keep security in mind.