Skip to main content
Glama
Seshat

Seshat

Official

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 synced

  • list_modules — how the codebase is organized, by layer or module

  • query_entities — find functions, classes, and routes by name, layer, or module

  • find_entry_points — routes, exports, and the public API surface

Investigate a symbol

  • get_entity — signature, callers, callees, data flow, side effects, and tables touched

  • get_dependencies — the real call chain, callers and callees

  • get_blast_radius — everything that breaks if you change it, transitively

  • get_data_flow — what a function reads, returns, and mutates

  • get_optimal_context — the minimal, ranked set of files to read before editing

  • find_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 (no try or .catch around that call), and results computed and dropped. Checked per call, not per function. get_entity and get_dependencies show 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 tools
find_by_constraintFind by ConstraintA
Read-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 CodeA
Read-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 PointsA
Read-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 GapsA
Read-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 LeaksA
Read-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 ViolationsA
Read-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 ViolationsA
Read-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 ClonesA
Read-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 StatusA
Read-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 MatrixA
Read-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 RadiusA
Read-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 ClustersA
Read-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 MetricsA
Read-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 FlowA
Read-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 DependenciesA
Read-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 DetailsA
Read-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 HotspotsA
Read-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 LineageA
Read-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 ContextA
Read-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 CoverageA
Read-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 TopologyA
Read-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 ModulesA
Read-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 ProjectsA
Read-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 EntitiesA
Read-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 TraitsA
Read-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 ProjectA
Idempotent

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 PathA
Read-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

    A4/5.0

    Scored across 27 tools

    Disambiguation4/5

    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.

    Naming Consistency5/5

    Every tool follows a consistent snake_case verb_noun pattern: get_, list_, find_, query_, sync_, trace_. No mixed conventions or vague names appear.

    Tool Count3/5

    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.

    Completeness4/5

    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

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides 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.
      4
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables 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 npm
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables 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.
      14
      Apache 2.0