MCP Server¶
libCalibGeom includes an MCP server that helps AI assistants write the best code for libCalibGeom and answer API usage questions accurately and up to date.
What is an MCP server?¶
- The MCP server is a Python script that runs locally on your machine.
- Think of it as a connector between your AI agent and libCalibGeom's documentation.
- The assistant can ask the MCP server for API references and examples.
- The server returns relevant results in a structured way, helping the agent provide more accurate and detailed responses and code.
- Keeps assistant answers anchored to the actual, current SDK version.
- Improves developer onboarding across C++, Python, and Rust.
Required deployment layout¶
Keep the relative folder structure intact for docs and examples.
The MCP server relies on the mcp, docs, and examples folders being present in the same layout as originally provide. Otherwise, the locations of those folders need to be specified (see below).
Start the MCP server¶
From the project root:
python3 mcp/run_libcalibgeom_mcp.py
If your deployment layout is custom:
python3 mcp/run_libcalibgeom_mcp.py \
--docs-root docs/libcalibgeom \
--examples-root examples
VS Code setup¶
- Open VS Code in your libCalibGeom workspace.
- Open the Command Palette with
Ctrl+Shift+P. - Run
MCP: Add server.... - Select
Command (stdio). - Add a local stdio server entry that runs (adjust path to absolute or relative location):
python3 mcp/run_libcalibgeom_mcp.py - Save configuration and reload/restart the assistant session.
- Test with prompts such as:
- "Show me the C++
CalibrationAPI." - "Write a libCalibGeom program for stereo camera calibration in Rust."
JetBrains setup (CLion / PyCharm)¶
- Open Settings/Preferences and search for
MCP. - Add a new MCP server.
- Select stdio/command mode.
- Configure command (adjust path to absolute or relative location):
python3 mcp/run_libcalibgeom_mcp.py - Save and restart/reload the assistant session.
What the assistant can ask the server¶
api_search(query, language=all, limit=10)api_lookup_symbol(symbol, language=all, exact=false, limit=20)api_get_doc_page(location, max_chars=4000)api_get_examples(query, language=all, limit=10)
Supported language filters: all, cpp, python, rust.
Practical guidance¶
- Prefer language-specific lookups when target language is known.
- Use
allfor broad discovery. - Typical pattern: search/lookup first, then fetch page details, then fetch examples.
Limitations¶
- Page retrieval returns normalized text, not full structured AST metadata.
- Result ranking can vary with query phrasing.
- Output quality depends on the generated docs and examples available at runtime.
(c) Calib.io ApS