Knowledge Graph MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Knowledge Graph MCP Server search for accounts in the software industry"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Knowledge Graph MCP Server
Model Context Protocol (MCP) server that exposes a fictional CRM knowledge graph — enterprise Accounts and customer Contacts — for querying from Claude, ChatGPT, Adobe Coworker, or any other MCP-compatible client.
The graph is a plain Turtle/RDF file (data/knowledge_graph.ttl), loaded
into memory with rdflib and queried via
SPARQL. All data is synthetic/made-up — it does not represent any real
company or person.
This server mirrors the deployment setup used by the sibling
intervals-mcp-serverproject (Docker + Render + optional OAuth), swapping a REST API integration for a self-contained knowledge graph.
What's in the graph?
8 fictional enterprise accounts across industries (manufacturing, financial services, software, retail, healthcare, logistics, energy, education), each with tier, region, ARR, employee count, health score, renewal date, and account owner.
19 fictional contacts linked to those accounts, each with a job title, sales role (Economic Buyer / Champion / Influencer / User), email, phone, champion flag, sentiment, and last-contacted date.
See src/kg_mcp_server/tools/schema.py (get_graph_schema tool) for the
full property list and namespace.
Related MCP server: EspoCRM MCP Server
Setup — Deploy to Render (recommended)
The fastest way to get started is to deploy the server to Render as a Docker Web Service. No local installation required.
1. Create a Web Service on Render
Push this folder to its own GitHub repository.
Go to render.com → New → Web Service (or use the included
render.yamlwith New → Blueprint).Connect your GitHub repository.
Configure the service:
Name:
kg-mcp-server(or your preferred name)Runtime: Docker
Instance Type: Free tier works fine
💤 Free tier cold starts: Render free-tier services sleep after 15 minutes of inactivity. The first request after sleeping may take 30-60 seconds while the container restarts and the graph reloads. Subsequent requests are fast.
2. Set Environment Variables
In the Render dashboard under Environment, add:
Key | Value | Description |
|
| Enables the remote transport (streamable HTTP) |
|
| Bind to all interfaces (required inside Docker) |
Optional — enable OAuth 2.0 to protect the endpoint:
Key | Value | Description |
|
| OAuth client ID; must match the connector config exactly |
|
| OAuth client secret / access token; must match the connector |
|
| Public HTTPS URL (no |
3. Deploy and Verify
Click Create Web Service — Render will build the Docker image and deploy
Wait for the build to complete (green status)
Note your service URL:
https://your-service-name.onrender.comTest by opening
https://your-service-name.onrender.com/mcpin a browser — you should get a response from the server
⚠️ Security Warning: Without OAuth, your Render endpoint is publicly accessible — anyone who discovers the URL can query the knowledge graph (read-only; there is no write/mutate capability). Either enable OAuth or do not share your service URL publicly.
Connecting Claude
Open Claude → Settings → Integrations (or MCP Servers)
Click Add
Fill in:
Name:
Knowledge GraphURL:
https://your-service-name.onrender.com/mcp(must end with/mcp)If OAuth is enabled, also set OAuth Client ID / OAuth Client Secret
Open a new conversation and ask "What MCP tools do you have available?" to confirm the connection.
Connecting ChatGPT / Adobe Coworker / other MCP clients
Any MCP-compatible client that supports remote (Streamable HTTP) servers can connect the same way:
MCP Server URL:
https://your-service-name.onrender.com/mcpOAuth Client ID / Secret if enabled
Available Tools
get_graph_schema— describe the graph's classes, properties, and namespaceget_graph_stats— triple/entity counts for the loaded graphlist_accounts— list/filter accounts by industry, tier, region, health scoresearch_accounts— free-text search across accountsget_account— full detail for one account, including its contactslist_contacts_for_account— list contacts working at a given accountsearch_contacts— free-text search across contactsget_contact— full detail for one contactrun_sparql_query— arbitrary read-only SPARQLSELECT/ASKquery
There is also an MCP resource, kg://guide, with a usage guide LLM clients
can load at the start of a conversation.
Troubleshooting Render Deployment
Service won't start — Check Render logs for build errors.
Claude/ChatGPT can't connect — Verify the URL ends with
/mcpand is publicly accessible. Try opening it in a browser."Authorization failed" with OAuth —
MCP_CLIENT_ID/MCP_CLIENT_SECRETmust match the connector exactly (case-sensitive),MCP_SERVER_URLmust be the public HTTPS URL without/mcp, and the connector URL must end with/mcp.Free tier cold starts — first request after sleeping may take 30-60 seconds.
Requirements
Python 3.12 or higher
uv (recommended package manager)
1. Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh2. Clone and install
cd kg_mcp_server
uv venv --python 3.12
source .venv/bin/activate # Windows: .venv\Scripts\activate
uv sync --all-extrasConfigure Claude Desktop (stdio)
mcp install src/kg_mcp_server/server.py --name "Knowledge Graph"Or manually add to claude_desktop_config.json:
{
"mcpServers": {
"Knowledge Graph": {
"command": "uv",
"args": [
"run", "--with", "mcp[cli]",
"--with-editable", "/path/to/kg_mcp_server",
"mcp", "run", "/path/to/kg_mcp_server/src/kg_mcp_server/server.py"
]
}
}
}Running over HTTP locally (for ChatGPT / remote testing)
export FASTMCP_HOST=127.0.0.1 FASTMCP_PORT=8000 MCP_TRANSPORT=http
python src/kg_mcp_server/server.pyForward the port with a tunnel (e.g. ngrok http 8000) to give a remote
client a public URL.
Editing the knowledge graph
Edit data/knowledge_graph.ttl directly — it's plain Turtle. Restart the
server (or call kg_mcp_server.graph.store.reload_graph()) to pick up
changes. Use KG_GRAPH_PATH to point at a different file entirely.
Development and testing
uv sync --all-extras
ruff check .
mypy src tests
pytest -v testsLicense
The GNU General Public License v3.0
Available Tools
9 toolsget_accountARead-only
Get full details for a single account, including its contacts.
Args: account: The account identifier (e.g. "acct-atlasforge"), or a name/substring to look up (e.g. "AtlasForge" or "atlasforge manufacturing"). include_contacts: Whether to also list contacts linked to this account (optional, defaults to True).
Inputs: account (required), include_contacts. Returns: result
get_contactARead-only
Get full details for a single contact.
Args: contact: The contact identifier (e.g. "contact-adriana-koll"), or a name/substring to look up (e.g. "Adriana Koll" or "koll").
Inputs: contact (required). Returns: result
get_graph_schemaARead-only
Describe the knowledge graph's classes, properties, and namespace.
Call this before writing a raw SPARQL query with run_sparql_query, or to understand what fields are available on accounts and contacts.
Inputs: no named parameters. Returns: result
get_graph_statsARead-only
Return basic statistics about the loaded knowledge graph (triple/entity counts).
Inputs: no named parameters. Returns: result
list_accountsARead-only
List enterprise accounts in the knowledge graph, optionally filtered.
Args: industry: Case-insensitive substring match on industry (optional). tier: Exact match on account tier, e.g. "Strategic", "Enterprise", "Mid-Market" (optional). region: Exact match on region code, e.g. "NA", "EMEA", "APAC" (optional). min_health_score: Only return accounts with healthScore >= this value (optional, defaults to 0 i.e. no filtering).
Inputs: tier, region, industry, min_health_score. Returns: result
list_contacts_for_accountARead-only
List contacts (people) who work at a given account.
Args: account: The account identifier (e.g. "acct-atlasforge") or a name/substring (e.g. "AtlasForge"). role: Optional exact match on contact role, e.g. "Economic Buyer", "Champion", "Influencer", "User".
Inputs: account (required), role. Returns: result
run_sparql_queryARead-only
Run a read-only SPARQL SELECT or ASK query directly against the knowledge graph.
Use this for questions the higher-level account/contact tools can't answer,
e.g. joins, aggregations, or custom filters. The graph uses the crm:
prefix (http://example.org/crm#) for all classes and properties — call
get_graph_schema() first to see available classes and properties.
Only SELECT and ASK queries are permitted; INSERT/DELETE/DROP/LOAD/CREATE
are rejected. PREFIX crm: <http://example.org/crm#> is available
automatically but may also be declared explicitly.
Args: query: The SPARQL query text, e.g. "SELECT ?name ?arrUsd WHERE { ?a a crm:Account ; crm:name ?name ; crm:arrUsd ?arrUsd . } ORDER BY DESC(?arrUsd) LIMIT 5"
Inputs: query (required). Returns: result
search_accountsARead-only
Search accounts by a keyword matched against name, industry, or account owner.
Args: keyword: Free-text keyword to search for (case-insensitive substring match).
Inputs: keyword (required). Returns: result
search_contactsARead-only
Search contacts by keyword matched against name, job title, or account name.
Args: keyword: Free-text keyword to search for (case-insensitive substring match). role: Optional exact match on contact role, e.g. "Economic Buyer", "Champion", "Influencer", "User".
Inputs: keyword (required), role. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
search_accounts (keyword) vs list_accounts (structured filters) both return account lists but the descriptions clarify the distinct filtering modes. Similarly search_contacts vs list_contacts_for_account are differentiated by scope. run_sparql_query has clear escape-hatch positioning relative to the higher-level tools.
All nine tools follow a consistent snake_case verb_noun pattern (get_graph_schema, search_accounts, list_accounts, get_contact, run_sparql_query, etc.). No mixed conventions or vague verbs.
Nine tools is well-scoped for a read-only CRM knowledge graph: two meta tools, three account tools, three contact tools, and a raw query escape hatch. Each earns its place.
Account and contact lifecycles are well covered for reading (list/search/get for both, plus schema, stats, and a raw SPARQL escape hatch for aggregations/joins). The surface is read-only by design, so no create/update/delete, and a bulk list-all-contacts view is missing but reachable via search_contacts or SPARQL.
Maintenance
Related MCP Connectors
Unofficial remote MCP server for Less Annoying CRM: OAuth 2.1, read-only grants, 10 tools.
API-first CRM for LLMs - contacts, companies, deals and activities over a native MCP server.
The HubSpot MCP Server acts as a bridge that enables AI assistants and Large Language Models to securely interact with HubSpot CRM data through natural conversation, without requiring users to understand complex API structures. It provides read-only access to standard CRM objects (contacts, companies, deals, tickets, products, invoices, and more) and their associations, secured via OAuth 2.0, allowing AI agents to perform tasks like summarizing deals, fetching company updates, and looking up record changes.
Read-only access to a company's ERP for Claude, ChatGPT and Gemini, with OAuth and an audit trail.
1
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA remote MCP server that connects Claude to a Twenty CRM workspace, enabling users to interact with CRM objects (People, Companies, Opportunities, and custom objects) through schema-driven tools for querying, creating, updating, and deleting records.1Apache 2.0
- AlicenseNot gradedqualityDmaintenanceA local, read-only MCP server for Claude Desktop that provides 16 tools to search and read EspoCRM accounts, contacts, opportunities, and related emails via a strict allowlist.MIT
- FlicenseNot gradedqualityDmaintenanceA read-only MCP server providing structured access to CRM data (companies, contacts, deals, activities) backed by SQLite. It enables LLMs to search contacts and deals, view full company accounts, find stale deals, and get pipeline summaries.-
- AlicenseNot gradedqualityBmaintenanceEnables MCP clients such as Cursor and Claude Desktop to query a GRC platform over stdio or HTTP, with read-only access by default and opt-in create, update, and delete tools subject to platform authorization.3Apache 2.0