sgraph
SGraph MCP Server
claude mcp add --transport stdio softagram-sgraph-mcp-server uvx softagram-sgraph-mcp-server
How to use
The SGraph MCP Server loads pre-built sgraph models into memory and exposes a set of MCP tools for querying software structure and dependencies. It is designed to accelerate AI agent work by providing fast, structured access to elements, their relationships, and aggregated dependency information through a stable, cached model interface. Available capabilities include loading models, retrieving root elements, navigating by path, inspecting incoming and outgoing dependencies, performing name and attribute based searches, and computing subtree analyses or dependency chains. This enables agents to explore large codebases efficiently, get hierarchical overviews, and reason about dependencies without repeatedly parsing raw sources.
To use the server, connect your agent to the MCP endpoints exposed by the sgraph MCP server. Typical workflows involve loading a model with sgraph_load_model, querying for specific elements with sgraph_get_element or sgraph_search_elements_by_name, and performing bulk analyses such as sgraph_get_subtree_dependencies or sgraph_get_dependency_chain to understand how components interact. The server also supports overview and high-level dependency queries that aggregate metrics at directory or module levels, which helps agents assess architecture and risk without enumerating every element. The path-based element structure (/Project/dir/file/element) provides consistent context for navigation across large projects, including external dependencies under /ProjectName/External.
How to install
Prerequisites
- Python 3.8+ (or the Python environment used by your MCP tooling)
- The UV (uv) CLI installed on your system to manage and run MCP servers
Installation steps
-
Install the UV CLI (if not already installed)
- Follow the UV project installation guide for your OS, ensuring the uv command is available in your PATH.
-
Install the SGraph MCP Server package
- Use UV to install the MCP server package. This example uses a package-name that corresponds to the sgraph MCP server module.
uvx install softagram-sgraph-mcp-server
-
Validate installation
- Ensure the package provides an executable entry point or module that the UV tool can run. You should be able to invoke the server via the provided mcp configuration.
-
Start the server (example)
- Depending on your environment, start the MCP server using the UV runner with the configured package name.
uv run softagram-sgraph-mcp-server
Notes
- If your environment uses a different entry point, adjust the command to point to the server's startup module or script.
- For development environments, you can build or seed a test sgraph model before loading via sgraph_load_model.
Additional notes
Environment and configuration tips:
- Ensure your models are loaded into memory before accepting requests to avoid cold-start latency.
- Use sgraph_load_model to preload models and then use sgraph_get_model_overview for quick sanity checks.
- When performing large subtree analyses (sgraph_get_subtree_dependencies), consider setting include_external and max_depth to tune performance.
- If you encounter permission or path issues, verify that the uv runtime is correctly configured and that the MCP server has access to the model files.
- For security, validate inputs with sgraph_validators and constrain scope with explicit paths to prevent unintended data exposure.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP