MCP-openproject
View the deployed MCP function endpoint: https://gilded-fudge-69ca2e.netlify.app/mcp (Note: This endpoint is intended for MCP clients, not direct browser access).
This project provides a Model Context Protocol (MCP) server, built with Express and deployed as a Netlify Function. It allows AI agents (like Langflow agents, Claude, Cursor, etc.) to interact with a self-hosted OpenProject instance via defined tools.
This example demonstrates:
Setting up an MCP server using @modelcontextprotocol/sdk
.
Integrating with an external API (OpenProject).
Deploying the MCP server serverlessly using Netlify Functions.
Handling environment variables securely in Netlify.
Providing a bridge for remote SSE clients (like cloud-hosted Langflow) to connect to the stateless Netlify function via mcp-proxy
and ngrok
.
The server exposes the following tools for interacting with OpenProject:
openproject-create-project
: Creates a new project.openproject-get-project
: Retrieves a specific project by ID.openproject-list-projects
: Lists all projects (supports pagination).openproject-update-project
: Updates an existing project's details.openproject-delete-project
: Deletes a project.openproject-create-task
: Creates a new task within a project.openproject-get-task
: Retrieves a specific task by ID.openproject-list-tasks
: Lists tasks, optionally filtered by project ID (supports pagination).openproject-update-task
: Updates an existing task (requires lockVersion
).openproject-delete-task
: Deletes a task.npm install -g netlify-cli
)mcp-proxy
tool used for SSE bridging)pip
(Python package installer)ngrok
account and CLI for testing remote SSE clients.Clone the repository:
git clone git@github.com:jessebautista/mcp-openproject.git cd mcp-openproject
Install Node.js dependencies:
npm install
Install Python mcp-proxy
:
(Ensure you have Python 3.10+ active)
# Check your python version first if needed: python3 --version # Install mcp-proxy (using pip associated with Python 3.10+): python3.10 -m pip install mcp-proxy # Or python3.11, python3.12 etc. depending on your version # If pipx is installed and preferred: pipx install mcp-proxy
Create Environment File:
.env
in the project root.OPENPROJECT_API_KEY="your_openproject_api_key_here" OPENPROJECT_URL="https://your_openproject_instance.com" OPENPROJECT_API_VERSION="v3"
.env
is listed in your .gitignore
file to avoid committing secrets.Run Netlify Dev Server:
.env
, and makes your function available.netlify dev
http://localhost:8888/mcp
.Test Locally with MCP Inspector:
mcp-remote
:npx @modelcontextprotocol/inspector npx mcp-remote@next http://localhost:8888/mcp
http://localhost:6274
) in your browser.Set Environment Variables in Netlify UI:
https://app.netlify.com/sites/gilded-fudge-69ca2e/configuration/env
).OPENPROJECT_API_KEY
: Your OpenProject API key.OPENPROJECT_URL
: Your OpenProject instance URL (e.g., https://project.bautistavirtualrockstars.com
).OPENPROJECT_API_VERSION
: v3
netlify/mcp-server/index.ts
reads these from process.env
. The hardcoded values should be removed (already done in our steps).Deploy via Git:
git add . git commit -m "Deploy OpenProject MCP server updates"
main
):git push origin main
Using MCP Inspector:
mcp-remote
to your live Netlify function URL:npx @modelcontextprotocol/inspector npx mcp-remote@next https://gilded-fudge-69ca2e.netlify.app/mcp
Connecting Remote SSE Clients (e.g., Cloud-Hosted Langflow):
Since the Netlify function is stateless (doesn't handle SSE connections directly via GET), and remote clients like Langflow often prefer SSE, you need a bridge. We use the Python mcp-proxy
tool combined with the JS mcp-remote
tool, and ngrok
for a public tunnel.
Step A: Start the Proxy Bridge Locally:
mcp-proxy
is installed):# Listen for SSE on local port 7865, run npx mcp-remote as the backend mcp-proxy --sse-port 7865 -- npx mcp-remote@next https://gilded-fudge-69ca2e.netlify.app/mcp
npx
command.Step B: Create a Public Tunnel with ngrok
:
ngrok
to expose the local port mcp-proxy
is listening on:ngrok http 7865
ngrok
will display a public "Forwarding" URL (e.g., https://.ngrok-free.app
). Copy this HTTPS URL.Step C: Configure Langflow:
https://lang.singforhope.org/
):
SSE
ngrok
public URL including the /sse
path required by mcp-proxy
(e.g., https://.ngrok-free.app/sse
).ngrok
-> mcp-proxy
-> mcp-remote
-> Netlify chain.(Note): This ngrok
setup is for testing/development. For a permanent solution, deploy the mcp-proxy
bridge to a persistent public server.
netlify.toml
)Ensure your netlify.toml
correctly redirects requests to the /mcp
path to your Express function handler:
[[redirects]] force = true from = "/mcp/*" # Use wildcard to catch all sub-paths if needed status = 200 to = "/.netlify/functions/express-mcp-server" [[redirects]] # Also redirect the base path force = true from = "/mcp" status = 200 to = "/.netlify/functions/express-mcp-server"
(Adjust redirects as needed based on your Express routing)
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!