Development··3 min read

Building an MCP Server Was Easier Than I Expected

How I built a Model Context Protocol server and connected it to our internal databases.

Friday Afternoon at 3 PM, Because Monday Reports Are Tedious

Every Monday, I share last week's metrics in Slack -- deployment count, bug count, response times. Every single week: open Grafana, take screenshots, count Jira tickets, organize it all in Google Sheets. About 30 minutes each time. I'd been repeating this for months.

Friday afternoon, a thought hit me. "What if I built an MCP server so I could just ask AI and get the numbers?" I started right there. (Half curiosity, half procrastination, if I'm being honest.)

What Even Is MCP?

Model Context Protocol. Anthropic announced it in late 2024. In simple terms, it's a standard interface that lets AI access external tools and data. Think of it as giving AI eyes and hands. When you ask "what was last month's revenue from our database?", the MCP server sits in the middle, executes the DB query, and passes the results back to the AI.

Friday Afternoon to Sunday Evening: Done

Built it with Node.js + TypeScript. The MCP SDK is well-designed, so standing up the server skeleton was quick. The core part is defining Tools -- functions that AI can invoke.

I built three Tools. getDeploymentStats for deployment count and success rate, getBugCount for Jira bug ticket counts, getResponseTime for average response time from Grafana. You define each Tool's input/output schemas using JSON Schema, and the AI just understands it.

Total codebase: 280 lines. Honestly felt too short to be real. (The MCP SDK does the heavy lifting, not me.)

Half the Time Went to API Key Setup

The most time-consuming part wasn't code -- it was Jira API and Grafana API authentication. Getting API keys issued, permissions configured, token refresh handled. Spent more time on this than writing the 280 lines of code. Always the way. The real work lives outside the code.

Connected It and It Just Worked

Connecting the MCP server to Claude Desktop is just adding a path to a config file. I asked "how many deployments last week?" and the AI automatically called getDeploymentStats and answered. Ask "how many Critical bugs last week?" in natural language and the AI constructs the right parameters itself.

This is MCP's real value. You don't have to call APIs directly -- you get data just by having a conversation.

Monday Demo Went Over Well

Good reactions. When the PM asked "can we add product metrics to this?", showing that it only requires adding one more Tool got a big response. We've since added a Google Analytics Tool too, bringing the total to 5. The 30-minute weekly report now takes 2 minutes.

Security Is No Joke Though

The fact that AI can execute DB queries means there's potential for accessing sensitive data through crafty prompts. I created a read-only database user and restricted accessible tables to a whitelist. My new rule: when giving AI access permissions, start at the level you'd give a new hire.

Glad I Built It

AI's real power isn't in standalone use -- it's when it connects to existing systems. You can build an MCP server in half a day, so if you have any repetitive task that involves gathering data from multiple systems, give it a shot. A Friday afternoon's procrastination saved my Monday mornings.

Related Posts