Seshat
OfficialWith Seshat’s MCP server you can sync a repository into a typed symbol graph and query its structure, dependencies, data flow, history, and code-health signals to guide AI agent edits.
Check account plan, credits, and available tools (
get_account_status).List, sync, and manage codebase projects (
list_projects,sync_project).Search and inspect symbols like functions, classes, and routes by name, layer, module, or language (
query_entities,get_entity,list_modules,find_entry_points).Analyze dependencies and impact: callers/callees, blast radius, optimal context, and dead code (
get_dependencies,get_blast_radius,get_optimal_context,find_dead_code).Trace data flow and database touches across calls (
get_data_flow,trace_data_path,find_by_constraintwith table).Audit architecture and code health: layer violations, coupling, auth matrix, error gaps, test coverage, ownership, exposure leaks, and semantic clones (
find_layer_violations,get_coupling_metrics,get_auth_matrix,find_error_gaps,get_test_coverage,find_ownership_violations,find_exposure_leaks,find_semantic_clones).Explore change history: lineage, hotspots, and co-change clusters (
get_lineage,get_hotspots,get_co_change_clusters).Query inferred behavioral traits (
query_traits) and syntactic constraints (find_by_constraint).Get the full API surface map (
get_topology).
Allows Seshat to access and analyze repositories from GitHub, including public repos cloned automatically and private repos via connecting a GitHub account, to build structural code intelligence and history insights.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Seshat what breaks if I change the process_payment function?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Seshat — structural code intelligence for AI agents
Your agent reconstructs your codebase from likelihood. Seshat compiles it.
Seshat turns a repository into a typed symbol graph (every function, class, route, and table, with its real dependency edges, data flow, and constraints) and serves it to your agent over MCP. So before your agent edits a function, it can ask what will actually break instead of guessing.
Backed by a compiled intermediate representation, not text search or embeddings: if Seshat says a function has three callers, it has exactly three.
Why
AI coding agents are fast but structurally blind. When an agent changes one function, it often cannot see everything that depends on it, so it silently breaks callers it never looked at. A large share of AI-introduced regressions come from exactly this. Seshat gives the agent the map.
Related MCP server: io.github.pmgarg/cgraphy
Try it first (no install, no login)
Paste any public repo at https://seshat.papyruslabs.ai/try and watch it trace what a change would break.
Install
npx -y @papyruslabsai/seshat-mcp setup <your-key>Get a free key at https://seshat.papyruslabs.ai (first extraction is free). The setup command writes your MCP config and stores the key.
Or configure manually (Claude Code, Cursor, or any MCP client):
{
"mcpServers": {
"seshat": {
"command": "npx",
"args": ["-y", "@papyruslabsai/seshat-mcp"],
"env": { "SESHAT_API_KEY": "your-key" }
}
}
}Tools
Point your agent at a repo with sync_project, then it investigates the way a senior
engineer does: orient, trace, verify.
Orient
list_projects— what is syncedlist_modules— how the codebase is organized, by layer or modulequery_entities— find functions, classes, and routes by name, layer, or modulefind_entry_points— routes, exports, and the public API surface
Investigate a symbol
get_entity— signature, callers, callees, data flow, side effects, and tables touchedget_dependencies— the real call chain, callers and calleesget_blast_radius— everything that breaks if you change it, transitivelyget_data_flow— what a function reads, returns, and mutatesget_optimal_context— the minimal, ranked set of files to read before editingfind_by_constraint— every function that touches a given table (or carries a given trait)find_dead_code— unreachable symbols, safe to delete
Check the calls themselves (JavaScript, TypeScript and Python)
query_call_sites— calls by their state: async calls never awaited (floating promises, promises tested as conditions), calls whose failure escapes the caller (notryor.catcharound that call), and results computed and dropped. Checked per call, not per function.get_entityandget_dependenciesshow the same state on each call.
Read the history (from the repo's commit record, backfilled on first sync)
get_lineage— how one function has actually changed: each commit typed by what moved (body, calls, data, signature), CI pass/fail and reverts, what changes alongside it, and what last forced a change here. Ask it before touching anything load-bearing.get_hotspots— where development happens and where it fails: the most-changed code, thrash spots where changes keep getting reverted or landing on red CI, and heavily used code nobody has touched (stability pressure)get_co_change_clusters— the hidden modules: code that changes together across files even when no import connects it, so a change to one member usually means the rest
Every answer comes from the compiled graph and discloses the coverage behind it. History is commit-resolution correlation and says so; it never claims causation it can't show.
Cross-cutting audit tools (test coverage, topology, semantic clones) are being hardened and will be added to this list as they land.
Privacy
Analysis runs in the Papyrus Labs cloud, by design: the compiled graph is the product's moat, and keeping extraction server-side is how that stays protected. Public repos are cloned from GitHub; private repos require you to connect your GitHub account. Source is processed to build the graph and cached to serve queries. See the privacy policy at seshat.papyruslabs.ai.
Pricing
First extraction is free. $0.03 per query after a free tier; a typical investigation is 5 to 15 queries. Details at https://seshat.papyruslabs.ai.
MIT licensed server. Named for the goddess who kept the records, built so your agent can read them.
Available Tools
27 toolsfind_by_constraintFind by ConstraintARead-onlyIdempotent
Find every function with a specific syntactic constraint tag — AUTH (requires authentication), DB_ACCESS (touches database), THROWS (explicit throw statement), PURE (no side effects), NETWORK_IO (makes HTTP calls), VALIDATED (has input validation). Also supports table-level queries: pass table="walks" to find every function that reads or writes the walks table (answers "what touches this table?" for schema migrations). Constraints are extracted from source syntax, not inferred. For semantic/behavioral properties (e.g., "can fail transitively"), use query_traits instead.
Inputs: constraint (required), table, project.
find_dead_codeFind Dead CodeARead-onlyIdempotent
Find functions that nothing calls. Walks the call graph from all entry points (routes, exports, tests) and flags symbols that are unreachable. Use this during cleanup or before a release to find safe deletion candidates.
Inputs: project, include_tests.
find_entry_pointsFind Entry PointsARead-onlyIdempotent
List the ways into the system: route/controller handlers, test entries, framework plugin registrations, and exported symbols (the public API surface), classified by kind and ranked by reach. Call it first when orienting in an unfamiliar codebase — it answers "where does execution start, and what is the public surface?" Complements list_modules (structure) and find_dead_code (its exact inverse: these are the reachability roots).
Inputs: project.
find_error_gapsFind Error GapsARead-onlyIdempotent
Find crash risks: functions that throw or have network/DB side effects whose callers don't catch errors. Returns the specific caller→callee pairs where exceptions can propagate unhandled. Use this before shipping to find missing error handling.
Inputs: project.
find_exposure_leaksFind Exposure LeaksARead-onlyIdempotent
Find places where public/API code directly accesses private internals, bypassing the intended abstraction boundary. Use this during API design reviews or before extracting a module.
Inputs: project.
find_layer_violationsFind Layer ViolationsARead-onlyIdempotent
Find places where the architecture is broken — a database repository calling a route handler, a utility importing a component. Returns every backward or skip-layer dependency that violates clean architecture.
Inputs: project.
find_ownership_violationsFind Ownership ViolationsARead-onlyIdempotent
Find memory and lifecycle issues — entities with complex ownership, unsafe blocks, escaping references, or illegal mutability on borrowed data. Returns 0 for most JS/Python codebases — a non-zero result in those languages indicates a serious boundary violation worth investigating. Most detailed results for Rust and C++.
Inputs: project.
find_semantic_clonesFind Semantic ClonesARead-onlyIdempotent
Find duplicated logic across the codebase. Normalizes variable names and compares code structure to catch identical algorithms in different files — even across different languages. Use this before a DRY refactor.
Inputs: project, min_complexity.
get_account_statusAccount StatusARead-onlyIdempotent
See your current plan, available tools, and credit balance. Call this if a tool returns a tier error or you want to know what tools are available.
Inputs: no named parameters.
get_auth_matrixGet Auth MatrixARead-onlyIdempotent
Audit authentication coverage. Shows which API routes and controllers require auth and which don't, plus inconsistencies like database access without auth checks. For large codebases, use the module parameter to drill into a specific module/directory. Most useful for backend codebases with middleware-based auth. Frontend frameworks (React, Vue) handle auth via component wrappers, which this tool won't detect as AUTH constraints.
Inputs: layer, module, project.
get_blast_radiusGet Blast RadiusARead-onlyIdempotent
Before modifying a function, call this to see everything that could break. Returns all transitively affected symbols — both upstream callers and downstream callees — with distance from the change point. Like git log --follow but for runtime impact. Designed for repeated use: as you discover new symbols with other tools, call this again on them to expand your understanding of the affected surface.
Inputs: entity_ids (required), project.
get_co_change_clustersGet Co-Change ClustersARead-onlyIdempotent
The codebase's hidden modules: groups of symbols that historically change together (≥3 shared commits, sweep commits excluded), computed from real commit history. Clusters that span multiple directories reveal coupling the file tree doesn't show. Call it when planning a change or splitting work across agents — touching one member of a cluster usually means touching the rest, even when no static dependency connects them. Correlation evidence, honestly framed; complements get_blast_radius (static reach) with empirical reach.
Inputs: project.
get_coupling_metricsGet Coupling MetricsARead-onlyIdempotent
Measure how tangled your code is. Returns coupling (cross-boundary dependencies), cohesion (within-group dependencies), and instability scores. High coupling + low cohesion = refactoring candidates. Start with group_by: "layer" for the architectural health view ("are my controllers more coupled than my services?"), then drill into group_by: "module" for specific hotspots.
Inputs: project, group_by.
get_data_flowGet Data FlowARead-onlyIdempotent
See what data a function reads, returns, and mutates (DB writes, state changes). Use this when debugging data bugs or when you need to verify whether a function has side effects before refactoring it.
Inputs: entity_id (required), project.
get_dependenciesGet DependenciesARead-onlyIdempotent
Trace who calls a function and what it calls, up to N levels deep. Use this instead of grep-for-function-name when you need the actual call chain — returns the dependency graph, not text matches. Covers callers (upstream), callees (downstream), or both.
Inputs: entity_id (required), depth, project, direction.
get_entityGet Entity DetailsARead-onlyIdempotent
Get everything about one function or class — its signature, callers, callees, data flow, constraints, source location, and database operations (which tables it reads/writes). Use this when you need to deeply understand a single symbol before modifying it. Returns more than reading the source file because it includes the dependency context.
Inputs: id (required), project.
get_hotspotsGet HotspotsARead-onlyIdempotent
Project-level change-history orientation: the most-changed entities (and what kind of change dominates each), low-survival thrash spots where changes don't stick, heavily-depended-on entities that haven't changed all window (interface freeze), and directories with no recent changes. Call it after list_modules when orienting in a codebase — it answers "where does development actually happen, and where does it fail?" from commit history rather than current structure. Complements get_lineage (one entity's story) with the project-wide map.
Inputs: project.
get_lineageGet LineageARead-onlyIdempotent
The change history of one symbol, typed by what kind of change each commit made (body, calls, data, signature, constraints…), with CI verdicts, reverts, rename tracking, co-change partners, and rejected PRs that touched it. Call before modifying anything load-bearing: it answers "how does this entity usually change, and what happened last time someone tried?" — which no text diff can. Complements get_blast_radius (current impact) with history (past behavior).
Inputs: entity_id (required), project.
get_optimal_contextGet Optimal ContextARead-onlyIdempotent
Before working on a function, call this to get the most relevant related code ranked by importance and fitted to a token budget. Returns a prioritized reading list of symbols you should understand — better than guessing which files to open. Designed for iterative use: call it on your target, read the top results, then call it again on any surprising dependencies to build a complete picture.
Inputs: target_entity (required), project, strategy, max_tokens.
get_test_coverageGet Test CoverageARead-onlyIdempotent
See which production functions are actually exercised by tests via the call graph — semantic coverage, not line coverage. Optionally ranks uncovered functions by blast radius so you know which missing tests are riskiest.
Inputs: project, weight_by_blast_radius.
get_topologyGet TopologyARead-onlyIdempotent
Get the full API surface map in one call — all routes, middleware, auth patterns, and database tables. Use this when you need to understand the overall architecture without reading every file. Returns the information you'd normally piece together from dozens of file reads.
Inputs: project.
list_modulesList ModulesARead-onlyIdempotent
Get a bird's-eye view of how the codebase is organized. Groups all symbols by architectural layer (route/service/component), module, file, or language with counts. Use this to orient yourself in an unfamiliar codebase before diving into specifics.
Inputs: project, group_by.
list_projectsList ProjectsARead-onlyIdempotent
Start here. Returns all synced codebases with their size, language, and project name. You need the project name for every other tool. If this returns empty, use sync_project to import the current repo.
Inputs: no named parameters.
query_entitiesQuery EntitiesARead-onlyIdempotent
Like grep but for code structure. Find functions, classes, and routes by name, architectural layer (route/service/component), or module. Returns matching symbols with their type, file, and layer — use this instead of grep when you need to find code by what it does, not by text content.
Inputs: layer, limit, query, module, +2 more.
query_traitsQuery TraitsARead-onlyIdempotent
Find functions by inferred behavioral trait — "fallible" (can fail, including transitively via callees that throw), "asyncContext" (carries async state), "generator" (yields values). Traits are semantic properties inferred from the call graph, not just syntax. Use this when you need to find all code with a specific capability. For syntactic tags (explicit throw statements, DB access), use find_by_constraint instead.
Inputs: trait (required), project.
sync_projectSync ProjectAIdempotent
Import a public GitHub repo into Seshat for structural analysis. Call this when list_projects returns empty or when the user wants to analyze a new repo. Detects the git remote automatically if no URL is provided. Extraction typically takes 5-30 seconds. After syncing, call list_projects to confirm the project is available. Use force: true to re-extract even if a cached snapshot exists (useful after code changes or when Seshat extraction has been updated).
Inputs: force, repo_url.
trace_data_pathTrace Data PathARead-onlyIdempotent
Follow data from one function through the call graph to its sinks. From a start entity it walks callees, records the data each hop consumes/produces/mutates, and reports the chain from the start to every sink the data reaches — database writes, network egress, filesystem writes — plus the tables touched. Call it before changing a function that handles real data: it answers "where does this data end up?", the cross-call composition get_data_flow (one entity) cannot give. Flags untrusted inputs at the source.
Inputs: entity_id (required), project, max_depth.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 27 tools
Tools have clearly distinct purposes, and descriptions actively cross-reference complementary tools (e.g., get_data_flow vs trace_data_path, query_traits vs find_by_constraint, get_dependencies vs get_blast_radius). A few pairs still require careful reading to distinguish—such as dependency tracing, blast radius, and optimal context—but the boundaries are explicitly stated.
Every tool follows a consistent snake_case verb_noun pattern: get_, list_, find_, query_, sync_, trace_. No mixed conventions or vague names appear.
27 tools is heavy for a single MCP server, though the deep code-intelligence domain justifies many specialized analyses. Several tools could likely be consolidated or grouped (e.g., multiple history and impact tools), but each addresses a distinct question.
Coverage is broad across structure, dependencies, data flow, history, architecture, security, testing, and dead code. Minor gaps exist for project lifecycle management (delete/update) and raw text/file search, but core analysis workflows are well covered.
Maintenance
Related MCP Connectors
Hosted code graph over MCP: exact callers, dependencies, and cross-repo blast radius for AI agents.
Codebase intelligence for AI agents — dead code, blast radius, ownership.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Team memory for AI coding agents and code reviews, reviewed by humans and served over MCP.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides code intelligence for AI coding agents by indexing repositories into a hybrid knowledge graph, enabling agents to query dependencies, impact, and context through 28 MCP tools.4Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables AI coding agents to query a codebase as a knowledge graph, providing token-budgeted context, search, and impact analysis via MCP tools.18 PyPIMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI coding agents to query a local, continuously updated symbol graph of a codebase, providing ranked search, caller/callee exploration, dependency paths, and git-diff impact analysis through MCP tools.10 npmApache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to query a semantic code graph over MCP, retrieving exact function source, definitions, callers/callees, impact analysis, and minimal test selection instead of whole files.14Apache 2.0