# mcp-sql

> mcp-sql is a free MCP server for developer tools. Read-only SQLite code index that lets an AI assistant search types, calls and dependencies. It runs as a hosted remote server, so there is nothing to install locally.

- **Kind:** MCP server
- **Pricing:** Free
- **Platforms:** CLI, API, Self-hosted, Web
- **Website:** https://mcp-sql.com
- **Repository:** https://github.com/malexple/indexer
- **MCP Registry name:** io.github.malexple/mcp-sql
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-30

## About

mcp-sql keeps a searchable index of a Java project, built by the Indexer tool into a single SQLite file, and serves it to an AI assistant over MCP. The assistant can look up classes and members, trace callers, read source by line range and run read-only SQL instead of loading whole repositories into context.

The index is built locally from the project's AST and git metadata, then uploaded with a write key. Clients connect with a separate read key, and the server exposes tools such as index_info, find_type, context, search and callers. A workspace can also be published through a self-hosted instance.

The hosted service issues short-lived key pairs through a Telegram bot. Databases and keys are deleted automatically when the chosen period ends, and the owner can revoke everything at once. It suits developers who want an assistant to reason about a Java codebase without giving it write access.

## Features

- **Type and member lookup:** Finds classes, interfaces, records and their methods or fields by simple name or fully qualified name.
- **Caller tracing:** Shows where a method is called, with file, line and the calling member when resolved.
- **Full-text search:** Searches indexed text files with SQLite FTS5 and returns snippets with paths.
- **Read-only SQL access:** Lets an assistant run single SELECT or WITH queries against the index.
- **Incremental patches:** Uploads small patches after code changes instead of re-sending the whole database.
- **Key expiry and deletion:** Keys and databases are removed automatically after the chosen period, and can be revoked immediately.

## Good for

- Letting an AI assistant navigate a large Java project without reading every file
- Finding all callers of a method before changing its signature
- Checking Gradle module dependencies across a multi-module build
- Sharing a read-only code index with an assistant for a short review session

## Tools

From the tool list in its README, going by the names, 4 of 8 tools read data; 4 names don't say. From the server's own tool labels and tool names; not verified by us.

- `index_info`: Lists projects, commit, branch, counters and staleness notes.
- `find_type` (name suggests: reads): Finds a type by simple name, fqn or suffix.
- `context`: Overview of a type including supertypes, members, dependencies and callers.
- `read_source` (name suggests: reads): Returns source of a type or of members by signature prefix.
- `read_lines` (name suggests: reads): Returns a range of lines from a file, up to 400 per call.
- `search` (name suggests: reads): Full-text search over indexed text files.
- `callers`: Lists where a method is called.
- `sql`: Runs one read-only SELECT or WITH query on the index.

## FAQ

### Can the assistant change my code?

No. The MCP service is read-only for clients, and the read key cannot upload or modify data.

### Which languages are supported?

Java is implemented. JavaScript, Zig and Kotlin are listed as not yet implemented.

### What happens to my data when keys expire?

When keys expire without renewal, the databases are deleted automatically, usually within a minute.

### Which MCP clients can connect?

Any MCP client that supports Streamable HTTP and a Bearer key, such as Perplexity custom connectors.

### Is mcp-sql free?

Yes. mcp-sql is free to use.

### What are the best alternatives to mcp-sql?

The closest alternatives to mcp-sql are mcp-sqlite, mcp-injector, mcp-server-toolkit, db-mcp (SQLite MCP Server) and mcp.

## Where this comes from

- Description: written from the project's README, the project's website and its MCP Registry entry.

## Alternatives

- [mcp-sqlite](https://ai-powered.com/mcp/mcp-sqlite-2): mcp-sqlite is an open-source MCP server for databases.
- [mcp-injector](https://ai-powered.com/mcp/mcp-injector): mcp-injector is a freemium MCP server for ai models and llm tooling.
- [mcp-server-toolkit](https://ai-powered.com/mcp/mcp-server-toolkit): mcp-server-toolkit is an open-source MCP server for developer tools.
- [db-mcp (SQLite MCP Server)](https://ai-powered.com/mcp/db-mcp-sqlite-mcp-server): db-mcp (SQLite MCP Server) is an open-source MCP server for databases.
- [mcp](https://ai-powered.com/mcp/mcp-9): mcp is an open-source MCP server for developer tools.
- [CICADA](https://ai-powered.com/mcp/cicada): CICADA is an open-source MCP server for developer tools.
- [mcp-code-indexer](https://ai-powered.com/mcp/mcp-code-indexer): mcp-code-indexer is an open-source MCP server for developer tools.
- [DB MCP](https://ai-powered.com/mcp/db-mcp): DB MCP is an open-source MCP server for databases.

---
Source: https://ai-powered.com/mcp/mcp-sql
