Repolode
dosco

dosco/graphjin

A Go compiler and runtime that exposes databases, files and code to AI agents through GraphQL and MCP, with guarded access and an auditable execution path.

Stars
3,234
Forks
206
Open issues
18
Last commit
16 hours ago

What is it?

GraphJin compiles GraphQL queries into SQL for databases such as PostgreSQL, MySQL, MongoDB, SQLite, Oracle and MSSQL, and also serves REST, real-time subscriptions and Apollo Federation subgraphs. Relationships between tables become navigable joins, so a single GraphQL request turns into one optimized query without resolvers or an ORM.

For AI agents, GraphJin provides an MCP surface that lets a model discover schema, validate filters and run approved saved queries instead of holding raw database credentials. It also indexes source code with tree-sitter into a SQLite cache (CodeSQL), exposes object stores such as S3, GCS and local files as tables, and includes a server-side agent endpoint plus watches that re-run subscriptions and record changes in an inbox.

The project ships as a single binary with npm, Homebrew, Scoop, Docker and deb/rpm packages, and includes a built-in demo and web console for trying it locally.

Key features

  • 01Compiles GraphQL queries into single optimized SQL statements across many databases.
  • 02Exposes databases, object stores and source code through one GraphQL and MCP surface.
  • 03Provides MCP tools for schema discovery, filter validation and approved query execution.
  • 04Supports real-time subscriptions over WebSockets and Server-Sent Events.
  • 05Indexes source trees with tree-sitter so code can be queried alongside data.
  • 06Offers a server-side agent endpoint and watches that deliver results to an inbox or webhook.

Use cases

  • Giving an AI assistant read access to a production database without sharing raw credentials.
  • Building a GraphQL API over an existing SQL database without writing resolvers.
  • Querying object-store files like database tables from GraphQL or REST.
  • Asking questions that connect database tables with the source code that uses them.

Quick start

  1. 1

    Install GraphJin via npm

    npm install -g graphjin
  2. 2

    Start the built-in demo app

    graphjin serve --demo

Things to know

  • The built-in AI agent needs a model API key from OpenAI, Anthropic, or Google.
  • Demo and examples run on SQLite and Docker-based setups, so connecting your own databases requires creating and configuring an app.

In collections

Topics

FAQ

What is graphjin?
A Go compiler and runtime that exposes databases, files and code to AI agents through GraphQL and MCP, with guarded access and an auditable execution path. GraphJin compiles GraphQL queries into SQL for databases such as PostgreSQL, MySQL, MongoDB, SQLite, Oracle and MSSQL, and also serves REST, real-time subscriptions and Apollo Federation subgraphs. Relationships between tables become navigable joins, so a single GraphQL request turns into one optimized query without resolvers or an ORM.
Is graphjin free to use? What license does it have?
graphjin is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is graphjin still maintained?
Actively maintained. The last commit to graphjin was on Nov 6, 2026.
What can I use graphjin for?
Giving an AI assistant read access to a production database without sharing raw credentials. Building a GraphQL API over an existing SQL database without writing resolvers. Querying object-store files like database tables from GraphQL or REST. Asking questions that connect database tables with the source code that uses them.
How do I install graphjin?
Install GraphJin via npm: npm install -g graphjin Start the built-in demo app: graphjin serve --demo
Where can I get graphjin?
The source code and installation instructions are on GitHub: https://github.com/dosco/graphjin

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects