This MCP SSE Server on Google Cloud Run provides a secure way to share your Model Context Protocol server with team members before official authentication features are available. By leveraging Google Cloud Run and User-Based IAM Authentication, you can allow clients to access your custom MCP server over the internet with proper security controls.
The MCP server is hosted on Google Cloud Run. Using Cloud Run IAM Authentication, you can securely connect to the server from the internet by creating a proxy connection with the Google Cloud SDK.
This setup should work with minimal configuration if you already have Docker and the gcloud CLI installed locally:
deploy.sh
with your project id, service account email, and other detailsmcp_proxy.ts
along with your project idnpx ts-node mcp_proxy.ts
Before deployment, you can test the server locally:
npm install
npm run dev
deploy.sh
script with your project details:
PROJECT_ID
: Your Google Cloud project IDREGION
: Your preferred GCP regionSERVICE_ACCOUNT_EMAIL
: The service account email with appropriate permissionschmod +x deploy.sh
./deploy.sh
The deployment script will build a Docker container, push it to Google Container Registry, and deploy it to Cloud Run with authentication enabled.
Run the MCP proxy locally to connect to your deployed server:
npx ts-node mcp_proxy.ts
The proxy will:
Start the proxy connection:
npx ts-node mcp_proxy.ts
Add your local proxy server to Cursor:
Test the connection by starting a new composer in agent mode and asking a question
If you experience connection problems:
mcp_proxy.ts
matches your deployed serviceThis setup provides strong security advantages:
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 > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.