MCP for data: tools, resources and prompts explained

An MCP server offers an AI app three things: tools it can call, resources it can read and prompts it can reuse. What each one looks like when the server sits in front of a database or a BI model, and what to allow.

Short answer: the Model Context Protocol (MCP) is an open standard for connecting AI apps to outside systems. A server offers three kinds of thing. Tools are actions the AI can call, like "run this read-only query". Resources are data it can read, like a table's schema. Prompts are reusable templates, like "explain this query". For data, put the schema in resources, keep tools read-only unless there is a reason, and use prompts for the questions your team asks every week.

Without MCP, an AI assistant knows your database only from what you paste in. With an MCP server in front of it, the assistant can look up the schema itself and run the query you approved, through one standard any MCP client understands.

Nothing loads from YouTube until you press play. Then Google receives your IP address and may set its own storage. Narrated with an AI-generated voice. Privacy

What are the three parts, for data?

Toolsactions with inputs: run_query(sql), list_tables(), sample_rows(table, n)
Resourcesthings to read: each table's schema, the data dictionary, the metric definitions
Promptstemplates the user picks: "explain this query", "write a monthly summary"
An MCP server in front of a database

Where does the server run?

An MCP clientClaude Code, an IDE, a desktop app
Local serverruns on your machine as a program the client starts (stdio); good for a database on your network
Remote serverruns online, reached by URL (HTTP); good for a shared service with its own sign-in
Two ways a server runs

What should a data server allow?

AllowBe careful with
Reading schemas and the data dictionaryWrite access of any kind
Read-only queries with a row limitQueries without a limit on a big table
A sample of rows from a test databaseProduction data with personal information
Running saved, reviewed queriesFree-form SQL against the warehouse

The safest setup uses a database login that can only read, so even a wrong tool call cannot change data.

Where can you check this?

Where do you start?

Connect one to Claude Code with connect Claude Code to a database, or start with a public, read-only one: the Microsoft Learn MCP server.

Keep reading

More from the blog.

Every post

Next

Building this? Say hello.

A question about this post, a pattern you would build differently, or the next thing you want written out: Behnia reads every message.