feat(mcp): add MCP stdio server with access-level gated tools)#305
feat(mcp): add MCP stdio server with access-level gated tools)#305123yongming wants to merge 3 commits intovolcengine:mainfrom
Conversation
- Update _optional_int to exclude bool type (isinstance bool is int subclass) - Add parametrized tests for limit/offset with true/false values - Add MCP server module and CLI mcp command - Update README with MCP server documentation
- Add four-tier access level model: readonly < ingest < mutate < admin - Expose session, relation, filesystem, and pack tools gated by level - Register backward-compatible alias openviking_add_resource -> openviking_resource_add - CLI: --enable-write maps to --access-level mutate for compatibility - Tests: all 45 MCP tests pass (3 skipped, 0 failed)
|
|
|
thx. I will look into this feature. If that’s true mcp http mode is better to share agfs resource. But http mode mcp server is implemented on top of ov server. |
Review: Existing HTTP Server vs New MCP ImplementationHi @123yongming, great work on this MCP server implementation! I did some research on the current codebase and wanted to share insights that might help the review: Current State of OpenViking ServerOpenViking already has a comprehensive HTTP Server implementation using FastAPI:
What This PR AddsYour PR introduces a new MCP stdio server at
Key InsightThese are complementary, not duplicate:
Suggestion for Future IterationConsider leveraging the existing HTTP server as a backend for an MCP-over-SSE or MCP-over-HTTP transport. This would allow:
The current stdio implementation is perfect for local embedded use. A future PR could add: # Hypothetical future extension
openviking mcp --transport sse --url http://localhost:8000This would bridge your excellent MCP tool layer with the existing HTTP infrastructure. Great work on the four-tier access model and comprehensive test coverage! |
Description
This PR introduces OpenViking MCP Server V1 support in embedded mode (
stdiotransport), including:readonly/ingest/mutate/admin)openviking mcpwith--access-leveland compatibility flag--enable-writeIt also improves argument validation in MCP tool dispatch (e.g. rejecting boolean values for integer fields).
Related Issue
N/A
Type of Change
Changes Made
openviking/mcp/__init__.pyopenviking/mcp/permissions.pyopenviking/mcp/server.pyopenviking/mcp/tools.pyopenviking_cli/cli/commands/mcp.pyopenviking_cli/cli/commands/__init__.pypyproject.toml([project.optional-dependencies].mcp)tests/mcp/test_tools.pytests/mcp/test_server.pytests/mcp/test_protocol_stdio.pytests/cli/test_cli.pytests/cli/conftest.pyREADME.mdREADME_CN.mdTesting
Notes:
python -m py_compile.pytestexecution was not completed in this environment (missing pytest dependency); CI is expected to validate lint/test suite.Checklist
Screenshots (if applicable)
N/A
Additional Notes