GraphJin

A GraphQL compiler and MCP server that puts databases, files and code indexes behind one governed graph

By Spacy (individual) Go Local · stdio, Streamable HTTP DatabasesDeveloper tools

75 popularity score ★ 3.2k ↓ 833/wk

Connect your client

Local (once it is running)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude CodeTerminal
claude mcp add --transport http graphjin http://localhost:8080/api/v1/mcp
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "graphjin": {
      "url": "http://localhost:8080/api/v1/mcp"
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "graphjin": {
      "type": "http",
      "url": "http://localhost:8080/api/v1/mcp"
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.graphjin]
url = "http://localhost:8080/api/v1/mcp"
Gemini CLITerminal
gemini mcp add --scope user --transport http graphjin http://localhost:8080/api/v1/mcp
Local (npm)

Add in one click

Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.

Or add it by command or config

FirstTerminal
npm install -g graphjin
graphjin serve new <APP_NAME>
Claude CodeTerminal
claude mcp add graphjin -- graphjin mcp --path '<ABSOLUTE_PATH_TO_APP>'
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "graphjin": {
      "command": "graphjin",
      "args": [
        "mcp",
        "--path",
        "<ABSOLUTE_PATH_TO_APP>"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "graphjin": {
      "command": "graphjin",
      "args": [
        "mcp",
        "--path",
        "<ABSOLUTE_PATH_TO_APP>"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "graphjin": {
      "type": "stdio",
      "command": "graphjin",
      "args": [
        "mcp",
        "--path",
        "<ABSOLUTE_PATH_TO_APP>"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.graphjin]
command = "graphjin"
args = ["mcp", "--path", "<ABSOLUTE_PATH_TO_APP>"]
Gemini CLITerminal
gemini mcp add --scope user graphjin graphjin -- mcp --path '<ABSOLUTE_PATH_TO_APP>'

Settings 3

GRAPHJIN_USER_ID Optional: User ID the stdio session acts as; overrides mcp.stdio_user_id, overridden by --user-id.
GRAPHJIN_USER_ROLE Optional: Role the stdio session acts as, which decides what it may query; overrides mcp.stdio_user_role.
ANTHROPIC_API_KEY Optional: Model key that enables the built-in agent and ask_graphjin_agent; OPENAI_API_KEY or GOOGLE_APIKEY also work.

What it does

GraphJin is a Go service that reads the schema of the databases you point it at and turns GraphQL requests into single SQL statements. It supports PostgreSQL, MySQL, MongoDB, SQLite, Oracle, MSSQL, Snowflake, Redshift, BigQuery and Cassandra, plus object stores (local disk, S3, GCS) shown as tables and a CodeSQL index that makes a source tree queryable. The same engine serves an MCP surface, so an assistant can look up what tables, relationships and saved queries exist before it runs anything.

The MCP side is deliberately small. The base set is graphql_help and query_catalog for discovery, execute_saved_query for allow-listed queries and validate_where_clause for checking filters. execute_graphql (arbitrary queries) appears only when mcp.allow_raw_queries is on; get_current_config and validate_config appear only in dev mode, and update_current_config additionally needs mcp.allow_config_updates; ask_graphjin_agent appears only when the built-in agent is enabled with a model provider key. That makes nine tools at most, which the README never totals (serv/mcp.go, v3.21.13).

The README only shows the HTTP endpoint at /api/v1/mcp (Streamable HTTP, served by graphjin serve), but the binary also has a stdio mode: graphjin mcp --path <app folder>. When ~/.config/graphjin/client.json exists from graphjin mcp setup, the same command instead proxies stdio traffic to that remote GraphJin server (cmd/cmd_mcp.go). A built-in demo (graphjin mcp --demo) runs on SQLite with seeded data.

What it needs

RuntimeNode.js

The graphjin binary: npm install -g graphjin (its postinstall step downloads the platform binary), Homebrew, Scoop, .deb/.rpm releases or the dosco/graphjin Docker image. A GraphJin app folder made with graphjin serve new <name>, whose config holds the database connection strings. For the HTTP endpoint, start graphjin serve --path <app folder>. The optional built-in agent needs an OPENAI_API_KEY, ANTHROPIC_API_KEY or GOOGLE_APIKEY.

Limits

Without mcp.allow_raw_queries (default false in serv/config.go, auto-enabled in dev mode) an assistant can only run saved, allow-listed queries. Config tools exist only in dev mode; update_current_config also needs mcp.allow_config_updates (default false). In production mode CodeSQL stops watching source files live. Apollo Federation _entities resolution is not implemented yet. Some dialects do not support batched subscriptions. Legacy discovery tools and HTTP helper endpoints are off unless mcp.legacy_discovery is set.

Who it suits

Suits teams that want an assistant to query several company databases, warehouses and files through one permission-aware layer, with saved-query allow-lists and read-only flags rather than raw credentials, and who can run and configure a Go service. It is heavy for someone who only wants to ask questions of a single local database: it needs an app folder and config before it does anything beyond the demo. Pick it over a plain SQL server when you want role-based limits and audit logs around what the assistant can run.

Tools 9

graphql_help
Points the caller to the right catalog topic for a broad or unclear task
query_catalog
Searches or filters the catalog of tables, relationships, workflows, config recipes and policies
execute_saved_query
Runs a saved, allow-listed query by name with variables
validate_where_clause
Checks a filter against a table before it is used
execute_graphql
Runs an arbitrary GraphQL query or mutation; only when mcp.allow_raw_queries is on
get_current_config
Reads the running configuration or one section of it; dev mode only
validate_config
Dry-runs a configuration change without applying it; dev mode only
update_current_config
Changes configuration with preview then apply; dev mode with mcp.allow_config_updates
ask_graphjin_agent
Hands one instruction to the server-side agent and returns a typed answer; only when the agent is enabled

Similar servers