MCPcopy Create free account
hub / github.com/cocoindex-io/cocoindex-code / mcp

Function mcp

src/cocoindex_code/cli.py:990–1003  ·  view source on GitHub ↗

Run as MCP server (stdio mode).

()

Source from the content-addressed store, hash-verified

988@app.command()
989@_catch_daemon_start_error
990def mcp() -> None:
991 """Run as MCP server (stdio mode)."""
992 import asyncio
993
994 project_root = str(require_project_root())
995
996 async def _run_mcp() -> None:
997 from .server import create_mcp_server
998
999 mcp_server = create_mcp_server(project_root)
1000 asyncio.create_task(_bg_index(project_root))
1001 await mcp_server.run_stdio_async()
1002
1003 asyncio.run(_run_mcp())
1004
1005
1006async def _bg_index(project_root: str) -> None:

Callers

nothing calls this directly

Calls 3

require_project_rootFunction · 0.85
_run_mcpFunction · 0.85
runMethod · 0.80

Tested by

no test coverage detected