gmail_get_tablesLABSCO SUMMARY
A mailbox you can query, not one it can act on.
Mail is one of the riskiest things to hand an assistant, and the design here removes the part that worries people: the tools are table discovery and a SELECT, so it can read and summarise but has no way to send, delete or move anything. Messages and labels arrive as rows, which makes questions like what is still unanswered from last week a query rather than a scroll. Setup is a Maven build, a licensed driver install and a browser OAuth sign-in while building the connection string.
What it is
A local, read-only bridge between an assistant and Gmail. CData's JDBC driver exposes Gmail as relational SQL models; this server wraps the driver so a model can discover the tables and query them, and you can ask in plain language instead of writing SQL. It runs over stdio, so the client has to be on the same machine.
What you get
get_tableslists the tables the driver exposes, returned as CSV with a header rowget_columnslists the columns on one of those tables, in the same CSV shaperun_queryexecutes a SQL SELECT against live Gmail data- Tool names carry the prefix you set in the property file — the sample config uses
Prefix=gmail - A
Tablessetting that only picks which tables also get a ready-made description (blank means none); it does not limit what the tools can list or query, so limit the connection or the account it signs in with
Requirements
Java and Maven: mvn clean install builds CDataMCP-jar-with-dependencies.jar. Separately install the CData JDBC Driver for Gmail and license it by running java -jar cdata.jdbc.gmail.jar --license, entering TRIAL or a license key. Build the connection string with the same jar, authenticating in the browser if the source uses OAuth, then write a .prp file naming the driver path, the driver class cdata.jdbc.gmail.GmailDriver and that JDBC URL. Point your client at java -jar with the built jar and the .prp file.
Setup effort
Build from source — clone the repository, then point your client at the binary
USE CASES
Finding out how the mailbox is modelled
List the tables the driver publishes, then the columns on the one you need.
Summarising what arrived while you were away
Ask in plain language; the assistant writes the SELECT and reads the CSV back.
Finding a thread you half remember
Query messages by sender, date or label instead of guessing at search operators.
3 tools
Listed in project docs. Your client may show a different list.
gmail_get_columnsgmail_run_queryBEFORE YOU INSTALL
What to know first
Tools you get
3 tools named in the project's documentation. Tool names take your .prp Prefix; with Prefix=gmail they are gmail_get_tables, gmail_get_columns and gmail_run_query. The server is read-only (run_query executes SELECT only). The Tables setting does not limit what the tools reach; your connection's access does.
Where it runs
Both documented setups run the server on your machine.
INSTALLATION
Connect your client
Clone the repository, then point your client at the binary. This one is built from source rather than installed with a single command.
Server setup
git clone https://github.com/cdatasoftware/gmail-mcp-server-by-cdata.git
cd gmail-mcp-server-by-cdata
mvn clean installDownload and install the CData JDBC Driver for Gmail from https://www.cdata.com/drivers/gmail/download/jdbc
License the driver: java -jar cdata.jdbc.gmail.jar --license (enter name, email, and "TRIAL" or a license key)
Run java -jar cdata.jdbc.gmail.jar with no arguments to open the Connection String utility, test the connection, copy the connection string
Create gmail.prp with:
Prefix=gmail
ServerName=CDataGmail
ServerVersion=1.0
DriverPath=<YOUR_DRIVER_PATH>
DriverClass=cdata.jdbc.gmail.GmailDriver
JdbcUrl=<YOUR_JDBC_URL>
Tables=Tables only picks which tables also get a ready-made description for your assistant, and empty means none; the server can still list and query every table your connection string reaches, so to keep data out of reach, limit that connection or the account it signs in with.
Add the mcpServers entry below to claude_desktop_config.json, pointing java at CDataMCP-jar-with-dependencies.jar and at the .prp file, then fully quit and reopen the client
MCP Clients
Claude Desktop — macOS / Linux, Windows
{
"mcpServers": {
"gmail": {
"command": "<YOUR_PATH_TO_JAVA>",
"args": [
"-jar",
"<YOUR_PATH_TO_CDATA_MCP_JAR_WITH>",
"<YOUR_PATH_TO_GMAIL>"
]
}
}
}