mcp-server-product-studio
A full-feature MCP server that serves as a product-development copilot, providing RAG search, SQL queries, and inline chart visualizations from seeded product data, with per-user identity and its own OAuth login.
README
mcp-server-product-studio
A full-feature MCP server for the Connext platform ā a small product-development copilot. It shows how to combine, in one server:
- š Its own login ā the server is its own OAuth 2.1 provider with a simple
username/password page (same pattern as
mcp-server-example). - š A RAG tool ā semantic-ish search over product documents (customer interviews, feature requests, PRDs, competitor notes) with a dependency-free BM25 retriever.
- šļø A SQL tool ā a read-only SQL query over a seeded product database (features / experiments / metrics).
- š A chart MCP App ā tools that return an inline-SVG chart Connext renders in the chat, derived from the product data.
- š¤ Per-user identity ā tools run as the signed-in user (e.g. "my features").
It's fully self-contained: a seeded in-memory SQLite database + an in-memory doc corpus, so it clones and runs with zero external services. Built on FastMCP.
What it demonstrates
| Capability | Tool(s) | Backed by |
|---|---|---|
| Retrieve unstructured context (the "why") | search_product_docs |
rag.py ā BM25 over a doc corpus |
| Query structured records (the "what/when") | run_sql, describe_data |
db.py ā read-only SQLite |
| Visualise the data | chart_roadmap, chart_feature_adoption |
charts.py ā inline SVG MCP App |
| Know who's asking | all of them | own OAuth login (auth.py) |
The demo interactions that show them working together:
- "What are customers saying about onboarding?" ā RAG
- "Show build-stage features ranked by RICE" ā SQL ā chart
- "How is the Onboarding checklist doing?" ā SQL + adoption chart
- "Draft next sprint's priorities" ā RAG (pain points) + SQL (backlog)
Quick start
Requires Python 3.11+.
# 1. install
python -m venv .venv && source .venv/bin/activate
pip install -e .
# 2. run
python server.py
# -> serving on http://localhost:8000 (MCP endpoint: http://localhost:8000/mcp/)
# 3. in another terminal, connect the way a client does (opens a browser login)
python examples/connect_with_client.py
# sign in as alice / password123 (or priya / hunter2)
Demo users are product managers whose usernames own features in the data, so "my features" works:
| username | password | owns |
|---|---|---|
alice |
password123 |
Onboarding, Billing, SSO, ⦠|
priya |
hunter2 |
Growth, Activation, Dashboard, ⦠|
The tools
search_product_docs(query, limit=3) ā BM25 retrieval over the doc corpus in
rag.py (customer interviews, feature requests, support themes, competitor
notes, PRDs). Returns the most relevant passages with scores.
describe_data() ā run_sql(sql) ā the model calls describe_data for the
schema, then run_sql with a SELECT. The query runs against a SQLite file
opened read-only (mode=ro) and is additionally checked to be a single
read-only statement ā a tool can never mutate the data. The signed-in username is
available for WHERE owner = '<username>'.
chart_roadmap(owner=None) and chart_feature_adoption(feature) ā MCP
Apps. Each returns a ToolResult carrying both a text summary (what the model
reads) and a ui:// resource with self-contained HTML+SVG (what the user
sees). Connext renders the HTML in a sandboxed iframe.
The data (all seeded, self-contained)
db.py ā three tables modelling a team building a SaaS product:
features(id, title, stage, priority, rice_score, effort_weeks, owner, target_release)
stage ā idea ā discovery ā design ā build ā beta ā ga (NPD stage-gate)
experiments(id, feature_id, hypothesis, metric, control, variant, lift_pct, status)
metrics(feature_id, week, adoption, retention) (weekly time series)
rag.py ā ~10 short product documents (interviews, requests, PRDs, competitor
notes) that reference the same features, so RAG and SQL tell a joined story.
The chart MCP App
An MCP App is a tool whose result includes a ui:// resource carrying HTML.
The charts here are inline SVG built in charts.py ā no external scripts or
assets, so they render under the iframe's strict Content-Security-Policy ā and
they use the host's var(--mcp-color-*) variables so they match the chat's
light/dark theme. The two-series colours are a validated categorical palette
(blue/aqua, checked for colour-blind separation and contrast).
# a chart tool returns text (for the model) + a ui:// resource (for the user)
return ToolResult(
content=[
TextContent(text="Roadmap chart: 6 alice's features ā {...}"),
EmbeddedResource(resource=TextResourceContents(
uri="ui://product-studio/chart",
mimeType="text/html;profile=mcp-app",
text="<!doctype html>ā¦<svg>ā¦</svg>ā¦")),
],
structured_content={"counts": {...}},
)
Connecting it to Connext
Same as mcp-server-example ā this server is its own OAuth provider, so Connext
drives standard OAuth 2.1 with dynamic client registration:
- Expose the server on a public HTTPS URL and run it with
PUBLIC_URLset to that URL (every OAuth discovery endpoint is built from it). - Register it in Connext (Admin ā MCP Servers ā Add): URL
https://<your-host>/mcp, Transport HTTP, Auth OAuth, client id/secret blank (dynamic registration handles it). Enable Allow UI so the charts render. - Connect as a user ā click Connect, sign in on this server's login page, and the agent can call the tools as that user.
Taking it to production
This example keeps everything in memory / in a demo file so it's easy to read. For a real deployment:
- Users: replace
DEMO_USERSinauth.pywith your real user store + hashed passwords (or delegate to SSO ā see the siblingmcp-server-entra-example). - SQL: point
db.pyat your real warehouse (Postgres/Snowflake/ā¦) and keep the read-only + single-statement guardrails (add query timeouts + row limits). - RAG: swap the in-memory BM25 for a real vector store + embeddings (pgvector, etc.) and chunk your documents.
- Charts: the SVG builders scale fine; add a hover/tooltip layer for richer interactivity if your host allows scripts in the MCP App iframe.
- Tokens/HTTPS: persist tokens (or issue signed JWTs) and terminate TLS in
front; set
PUBLIC_URLto thehttps://URL.
The files
| File | What it does |
|---|---|
server.py |
Entry point: seeds the DB, builds the FastMCP server with its own OAuth login, registers tools + /health, runs it. |
auth.py |
The OAuth provider + login page + demo users (from mcp-server-example). |
db.py |
Seeded, read-only SQLite: features / experiments / metrics, plus the schema the SQL tool advertises. |
rag.py |
The document corpus + a dependency-free BM25 retriever. |
tools.py |
The five tools: search_product_docs, run_sql, describe_data, chart_roadmap, chart_feature_adoption. |
charts.py |
Theme-aware inline-SVG chart builders + the MCP App HTML wrapper. |
examples/connect_with_client.py |
A client that runs the same OAuth flow Connext does. |
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.