Start a MCP server as a subprocess

This commit is contained in:
Chiran Fernando 2025-04-04 17:29:02 +05:30
parent 72c44afc14
commit f78385ef23
5 changed files with 439 additions and 48 deletions

View file

@ -1,6 +1,6 @@
# config.yaml
mcp_server_base_url: ""
mcp_server_base_url: "http://localhost:8000"
listen_port: 8080
timeout_seconds: 10
@ -8,15 +8,28 @@ mcp_paths:
- /messages/
- /sse
# Subprocess configuration
command:
enabled: true
user_command: "npx -y @modelcontextprotocol/server-github" # User only needs to provide this part
base_url: "http://localhost:8000" # Will be used for CORS and in the full command
port: 8000 # Port for the MCP server
sse_path: "/sse" # SSE endpoint path
message_path: "/messages" # Messages endpoint path
work_dir: "" # Working directory (optional)
# env: # Environment variables (optional)
# - "NODE_ENV=development"
path_mapping:
/token: /token
/register: /register
/authorize: /authorize
/.well-known/oauth-authorization-server: /.well-known/oauth-authorization-server
# /token: /oauth/token
# /register: /oidc/register
# /authorize: /authorize
# /u/login: /u/login
# /.well-known/oauth-authorization-server: /.well-known/openid-configuration
cors:
allowed_origins:
- ""
- "http://localhost:5173"
allowed_methods:
- "GET"
- "POST"
@ -36,36 +49,35 @@ asgardeo:
org_name: "<org_name>"
client_id: "<client_id>"
client_secret: "<client_secret>"
default:
base_url: "<base_url>"
jwks_url: "<jwks_url>"
path:
/.well-known/oauth-authorization-server:
response:
issuer: "<issuer>"
jwks_uri: "<jwks_uri>"
authorization_endpoint: "<authorization_endpoint>" # Optional
token_endpoint: "<token_endpoint>" # Optional
registration_endpoint: "<registration_endpoint>" # Optional
response_types_supported:
- "code"
grant_types_supported:
- "authorization_code"
- "refresh_token"
code_challenge_methods_supported:
- "S256"
- "plain"
/authroize:
addQueryParams:
- name: "<name>"
value: "<value>"
/token:
addBodyParams:
- name: "<name>"
value: "<value>"
/register:
addBodyParams:
- name: "<name>"
value: "<value>"
# default:
# base_url: "https://dev-mw4ipgsq1454jrwm.us.auth0.com"
# jwks_url: "https://dev-mw4ipgsq1454jrwm.us.auth0.com/.well-known/jwks.json"
# path:
# /.well-known/oauth-authorization-server:
# response:
# issuer: "https://dev-mw4ipgsq1454jrwm.us.auth0.com/"
# jwks_uri: "https://dev-mw4ipgsq1454jrwm.us.auth0.com/.well-known/jwks.json"
# authorization_endpoint: "https://dev-mw4ipgsq1454jrwm.us.auth0.com/authorize?audience=mcp_proxy"
# # token_endpoint: "https://dev-mw4ipgsq1454jrwm.us.auth0.com/oauth/token"
# # registration_endpoint: "https://dev-mw4ipgsq1454jrwm.us.auth0.com/oidc/register"
# response_types_supported:
# - "code"
# grant_types_supported:
# - "authorization_code"
# - "refresh_token"
# code_challenge_methods_supported:
# - "S256"
# - "plain"
# /authroize:
# addQueryParams:
# - name: "audience"
# value: "mcp_proxy"
# /token:
# addBodyParams:
# - name: "audience"
# value: "mcp_proxy"
# /register:
# addBodyParams:
# - name: "audience"
# value: "mcp_proxy"