heroyin opened a new pull request, #78:
URL: https://github.com/apache/doris-mcp-server/pull/78

   ## Summary
   
   - Add CORS middleware to both `main.py` (DorisServer HTTP mode) and 
`multiworker_app.py` to enable cross-origin requests from browser-based MCP 
clients
   - Handle CORS preflight OPTIONS requests with proper headers
   - Inject CORS headers (`Access-Control-Allow-Origin`, 
`Access-Control-Allow-Credentials`, `Access-Control-Expose-Headers`) into all 
responses via a custom `send_with_cors` wrapper
   
   ## Motivation
   
   Browser-based MCP clients (e.g., web dashboards, Dify integration) cannot 
directly communicate with the Doris MCP Server due to CORS restrictions. This 
change enables cross-origin access for the HTTP transport mode, making it 
possible to use the server from any web origin.
   
   ## Changes
   
   - `doris_mcp_server/main.py`: Added CORSMiddleware to the Starlette app, 
OPTIONS preflight handling, and CORS header injection via send wrapper
   - `doris_mcp_server/multiworker_app.py`: Added CORSMiddleware to the 
multi-worker basic_app
   
   ## Test plan
   
   - [ ] Verify CORS preflight OPTIONS requests return proper headers
   - [ ] Verify cross-origin POST/GET requests succeed from a browser
   - [ ] Verify existing MCP client functionality is not affected
   - [ ] Verify stdio transport mode is not affected
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to