GraphMind MCP server
2026년 11월 13일 커밋Microsoft Graph의 엔드포인트 경로에 대한 AI 환각 현상을 방지하기 위해 API 인지형 검색 및 실행 레이어를 제공합니다.
다른 이름 askaresh/graphmind
- 스타
- 5
- Tools
- 9
- 다운로드, 30일
- —
- 최신 버전
- —
- 마지막 커밋
- 2026년 11월 13일
- 라이선스
- MIT
GraphMind MCP란?
GraphMind은(는) MCP server입니다. Microsoft Graph의 엔드포인트 경로에 대한 AI 환각 현상을 방지하기 위해 API 인지형 검색 및 실행 레이어를 제공합니다. 9개 도구를 제공합니다. 예: search_graph_api, get_endpoint_schema, call_graph_api.
프로젝트 README에서 생성된 요약
GraphMind MCP server 정보
Microsoft Graph를 사용하는 개발자는 GraphMind를 통해 AI 클라이언트가 잘못된 API 엔드포인트 경로를 생성하는 환각 현상을 방지할 수 있습니다. Cursor 또는 VS Code Copilot과 같은 AI 클라이언트와 Microsoft Graph API 사이에서 신뢰할 수 있는 검색 및 실행 레이어 역할을 수행합니다. 구조적 필터, cross-encoder reranker, 전체 스키마 주입을 포함하는 3단계 퍼널을 사용하여 AI가 자연어 쿼리에 대해 정확한 엔드포인트를 선택하도록 보장합니다.
이 server를 사용하려면 앱 등록이 완료된 Microsoft Entra 테넌트와 Python 3.11+ 환경이 필요합니다. 설정 시 로컬 환경 파일에 TENANT_ID 및 CLIENT_ID와 같은 자격 증명을 구성해야 합니다. server는 약 45,000개의 엔드포인트로 구성된 로컬 인덱스를 관리하며, 초기 설정 중에 80MB 크기의 reranker 모델을 다운로드합니다. 보안을 위해 POST 또는 DELETE와 같은 모든 쓰기 작업은 Graph 또는 Azure RM에 실행되기 전, 미리보기 단계를 통해 사용자의 명시적인 확인을 거쳐야 합니다.
활용 사례
- 1정확한 API 엔드포인트 찾기자연어를 사용하여 특정 작업에 적합한 Microsoft Graph 경로를 AI가 찾도록 요청합니다.
- 2페이지네이션된 사용자 데이터 조회페이지네이션을 통해 대규모 데이터 세트를 처리하면서 테넌트의 사용자 수 또는 목록을 요청합니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
GraphMind MCP 도구 9
README에서 감지됨search_graph_apiget_endpoint_schemacall_graph_apiget_changelogpaginateaggregatemax_pagessample_sizeconfirmed
| search_graph_api | — | |
| get_endpoint_schema | — | |
| call_graph_api | — | |
| get_changelog | — | |
| paginate | — | |
| aggregate | — | |
| max_pages | — | |
| sample_size | — | |
| confirmed | — |
구성
DEFAULT_API_VERSIONRERANKER_TOP_KSPEC_REPO_PATH
| 이름 | 설명 | 유형 |
|---|---|---|
| DEFAULT_API_VERSION | — | |
| RERANKER_TOP_K | — | |
| SPEC_REPO_PATH | — |
자동 검사
2026년 11월 14일에 실행됨전체 보고서 →아직 인증되지 않았습니다. 서버는 80점 이상의 점수, 심각한 결함 없음, 그리고 검사에 충분한 데이터를 갖추어야 합니다. 검사 방식 · 점수를 높이기 위해 수정할 항목
- 소스 저장소 연결 및 접근 가능askaresh/graphmind is public and reachablegithub.com/askaresh/graphmind ↗통과
- 패키지가 이 저장소를 소스로 명시검사되지 않음
- 빌드 출처(Sigstore 증명)검사되지 않음
- 오픈 소스 라이선스 (OSI)MITspdx.org/licenses/MIT.html ↗통과
- 최근 1년 내 커밋 또는 릴리스Last commit or release 2026-11-13github.com/askaresh/graphmind ↗통과
- OpenSSF Scorecard검사되지 않음
- 패키지 이름이 인기 패키지와 유사하지 않음검사되지 않음
- 패키지 및 해당 종속성에 중요한 보안 권고 없음검사되지 않음
- 모델에 대한 숨겨진 지침 없음9 tool descriptions and the README read; no override phrases, credential paths or hidden characters통과
- 파괴적인 도구에 라벨 표시됨No tool named like delete, drop or exec통과
- 원격 엔드포인트가 MCP 핸드셰이크에 응답검사되지 않음
README
GitHub에서 보기GraphMind
API-aware MCP server for Microsoft Graph — always fresh, never hallucinated.
GraphMind solves the core problem with AI + Microsoft Graph: LLMs have a training cutoff and will hallucinate endpoint paths for APIs released after training. GraphMind maintains a local, always-fresh index of the entire Graph API and uses a 3-tier funnel to find the correct endpoint for any natural language query.
Architecture
GraphMind sits between your AI client and Microsoft Graph. The AI never guesses endpoint paths — it searches a local, always-fresh index first, then executes the exact endpoint it found.
flowchart TD
user["Natural language prompt"] --> client["AI client (Cursor / VS Code Copilot)"]
client -->|"search_graph_api"| funnel["3-tier search funnel"]
funnel --> schemas["Ranked endpoint schemas injected into AI context"]
schemas --> pick["AI picks the exact endpoint"]
pick -->|"call_graph_api"| writeCheck{"Write method?"}
writeCheck -->|"GET"| exec["Execute against Microsoft Graph / Azure RM"]
writeCheck -->|"POST / PATCH / PUT / DELETE"| preview["Return preview (confirmed=false)"]
preview --> approve["User approves in chat"]
approve -->|"confirmed=true"| exec
exec --> result["Response (with pagination / aggregate)"]
The 3-tier search funnel
flowchart TD
query["Natural language query"] --> tier1["Tier 1: Structural filter"]
tier1 -->|"~45k endpoints to <= 500, ~1ms"| tier2["Tier 2: Cross-encoder rerank"]
tier2 -->|"top 20, ~100ms, local 80MB model"| tier3["Tier 3: Full schemas injected into AI context"]
tier3 --> pick["AI picks the exact endpoint"]
Search also applies domain hints (e.g. Cloud PC / snapshot queries auto-select
api_version=beta and narrow tags). Write calls require user confirmation
before execution.
Prerequisites
- Python 3.11+ and git on your PATH. CI tests Python 3.11.
- Internet access. The install downloads PyTorch via
sentence-transformers(often 1 GB or more), the first run clonesmsgraph-metadata, and the first search downloads an ~80MB reranker model. - A Microsoft Entra tenant with an app registration (see docs/entra_setup.md)
Quick Start
git clone https://github.com/askaresh/graphmind.git
cd graphmind
python -m venv .venv
# Windows PowerShell
.venv\Scripts\Activate.ps1
# Windows cmd
.venv\Scripts\activate.bat
# macOS / Linux
source .venv/bin/activate
pip install -e ".[dev]"
# Configure — copy the example env, then fill in TENANT_ID, CLIENT_ID, AUTH_MODE
copy .env.example .env # Windows (PowerShell / cmd)
cp .env.example .env # macOS / Linux
# Verify (auto-clones msgraph-metadata on first run)
python -m graphmind.cli stats
# Start MCP server
python -m graphmind.cli serve
Use that activated virtual environment for every later command. After activation, graphmind stats works as well. If PowerShell blocks the activate script, call the venv interpreter directly: .venv\Scripts\python.exe -m graphmind.cli stats (macOS / Linux: .venv/bin/python -m graphmind.cli stats).
AUTH_MODE and credentials are read from .env. See docs/entra_setup.md for app registration and permissions.
The spec repo is cloned to ./msgraph-metadata automatically when missing.
See docs/spec_lifecycle.md for the full lifecycle and
recommended CI workflow.
What to expect on first run
- Cold start (~4–6 min): the first tool call parses the full Graph OpenAPI spec (~45k endpoints) into an in-memory index. The MCP server responds to the handshake immediately and loads the index in the background; subsequent searches are instant until the process restarts. See docs/spec_lifecycle.md.
- One-time model download (~80MB): the cross-encoder reranker downloads on the
first
search_graph_apicall, then is cached locally.
Realistic time-to-first-query: GraphMind itself is clone-and-go in ~3 minutes. Because the one-time Entra app registration + admin consent and the cold-start parse are unavoidable, plan for ~10–15 minutes before your first live Graph call.
Cursor MCP setup
This repo includes .cursor/mcp.json. Credentials and AUTH_MODE stay in .env (not in MCP config):
{
"mcpServers": {
"graphmind": {
"command": "python",
"args": ["-m", "graphmind.mcp.server"],
"cwd": "${workspaceFolder}",
"env": {
"SPEC_REPO_PATH": "./msgraph-metadata",
"DEFAULT_API_VERSION": "v1.0",
"RERANKER_TOP_K": "20"
}
}
}
}
command must be the same interpreter you installed into. With the Quick Start venv, set it to ${workspaceFolder}/.venv/Scripts/python.exe on Windows, or ${workspaceFolder}/.venv/bin/python on macOS / Linux. A bare python only works when that python on PATH is the one that received pip install -e ".[dev]".
Keys in the MCP env block override the same keys in .env. Leave AUTH_MODE, TENANT_ID, CLIENT_ID, and secrets out of this block.
Enable GraphMind under Cursor Settings → MCP. The index loads in the background on the first tool call (~4–6 minutes cold; instant once warm). See docs/spec_lifecycle.md.
Agent behaviour for Graph queries is defined in .cursor/rules/graphmind-mcp.mdc.
VS Code (GitHub Copilot) MCP setup
This repo includes .vscode/mcp.json, which VS Code picks up automatically when you
open the folder. It uses VS Code's MCP schema (servers + "type": "stdio").
Credentials and AUTH_MODE stay in .env (not in the MCP config):
{
"servers": {
"graphmind": {
"type": "stdio",
"command": "python",
"args": ["-m", "graphmind.mcp.server"],
"cwd": "${workspaceFolder}",
"env": {
"SPEC_REPO_PATH": "./msgraph-metadata",
"DEFAULT_API_VERSION": "v1.0",
"RERANKER_TOP_K": "20"
}
}
}
}
Use the same venv interpreter for command as in the Cursor section above. MCP env values override .env.
Requires GitHub Copilot agent mode (Chat: Agent view). Open the Chat view, switch
to Agent, then Start the graphmind server from the MCP tools picker. As with
Cursor, the index loads in the background on the first tool call (~4–6 minutes cold).
Any other MCP-capable client works too. From the repo root, run
python -m graphmind.mcp.server with the venv interpreter.
MCP tools
Always use this workflow for tenant / Graph questions:
search_graph_api— natural language query; returns ranked endpoint schemasget_endpoint_schema— full parameters for a chosen path (optional)call_graph_api— execute the call against Graph or Azure RM
Additional tool:
get_changelog— recently decommissioned endpoints from the spec diff pipeline
call_graph_api options
| Parameter | Default | Purpose |
|---|---|---|
paginate |
false |
Follow @odata.nextLink for large GET collections |
aggregate |
true |
With paginate, return { total, sample } instead of full JSON |
max_pages |
50 |
Page limit when paginating |
sample_size |
10 |
Rows in aggregate sample |
confirmed |
false |
Required for writes — see below |
Write confirmation: POST, PATCH, PUT, and DELETE calls return a preview on the
first call (confirmed: false). Re-call with the same parameters and
confirmed: true only after the user explicitly approves. Set
GRAPHMIND_REQUIRE_WRITE_CONFIRMATION=false to skip (e.g. automation scripts).
404 handling: Failed calls suggest related endpoints from the local index when possible.
Example queries
| Question | Approach |
|---|---|
| How many users? | search → GET /users/$count or GET /users with paginate=true, aggregate=true |
| List Cloud PCs | search → GET /deviceManagement/virtualEndpoint/cloudPCs |
| Cloud PC restore points | search (beta) → resolve Cloud PC id → GET .../cloudPCs/{id}/retrieveSnapshots() |
| Reboot a Cloud PC | search → POST .../reboot → preview → user confirms → confirmed: true |
Many Windows 365 / Cloud PC APIs are beta-only. GraphMind auto-selects beta for Cloud PC and snapshot queries.
CLI
| Command | Description |
|---|---|
graphmind serve |
Start MCP server |
graphmind bootstrap |
Clone msgraph-metadata (also runs automatically) |
graphmind refresh |
Pull latest spec + diff |
graphmind scheduler |
Run daily/weekly spec refresh scheduler |
graphmind stats |
Index statistics |
graphmind search "query" |
Terminal search (debug; no domain hints) |
Helper scripts
Optional dev helpers under scripts/ bypass MCP (no write confirmation gate).
See scripts/README.md for details.
| Script | Purpose |
|---|---|
count_users.py |
Entra user count |
count_cloud_pcs.py / list_cloud_pcs.py |
Cloud PC inventory |
cloudpc_specs.py |
Cloud PC SKU details |
Tenant-specific scripts belong in scripts/local/ (gitignored, not on GitHub).
Run from repo root, with the venv activated: python scripts/count_users.py. These scripts force AUTH_MODE=client_secret and need CLIENT_SECRET in .env. Interactive mode is enough for the MCP server and is not enough for these scripts.
Configuration
See .env.example for the full list. Key variables:
| Variable | Default | Description |
|---|---|---|
DEFAULT_API_VERSION |
v1.0 |
Default API version for search and calls |
SPEC_AUTO_CLONE |
true |
Auto-clone msgraph-metadata on first run |
STRUCTURAL_FILTER_CEILING |
500 |
Max candidates before reranking |
RERANKER_TOP_K |
20 |
Endpoints returned after rerank |
GRAPHMIND_READ_ONLY |
false |
Block all write methods via MCP |
GRAPHMIND_REQUIRE_WRITE_CONFIRMATION |
true |
Preview before POST/PATCH/PUT/DELETE |
GRAPHMIND_MAX_PAGES |
50 |
Default page limit for pagination |
GRAPHMIND_MAX_RESPONSE_CHARS |
8000 |
Truncate large MCP responses |
TOKEN_CACHE_PATH |
./.graphmind_token_cache.json |
Persisted MSAL token cache |
After changing Entra permissions, delete the token cache and retry.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| First tool call hangs for minutes | Cold start — parsing ~45k endpoints + one-time ~80MB model download | Expected on first run (~4-6 min). The MCP server is responsive; the index loads in the background. Subsequent calls are instant until restart. |
git ... not recognized / spec never clones |
git not on PATH, or no internet |
Install git and ensure it's on PATH; GraphMind shells out to git clone. Or clone manually: git clone https://github.com/microsoftgraph/msgraph-metadata ./msgraph-metadata |
graphmind is not recognized |
The venv is not activated, or its Scripts folder is not on PATH |
Activate .venv, or run python -m graphmind.cli stats with that venv's Python |
AADSTS50011 redirect URI mismatch |
Interactive app registration is missing http://localhost |
Add it under Authentication → Mobile and desktop applications (see docs/entra_setup.md) |
No OpenAPI specs found under ./msgraph-metadata |
Auto-clone disabled or wrong path | Set SPEC_AUTO_CLONE=true, or run graphmind bootstrap, or point SPEC_REPO_PATH at an existing clone |
KeyError: 'CLIENT_SECRET' or auth fails at startup |
AUTH_MODE=client_secret/certificate without the matching value |
Set CLIENT_SECRET / CERT_PATH, or use AUTH_MODE=interactive for local dev (no secret needed) |
AADSTS65001 / consent or 403 Forbidden on calls |
App lacks the permission, or admin consent not granted | Add the permission in Entra and click Grant admin consent (see docs/entra_setup.md). Then delete .graphmind_token_cache.json and retry |
| Calls still 403 after adding permissions | Stale cached token without new claims | Delete .graphmind_token_cache.json so MSAL acquires a fresh token |
404 Not Found on a beta path |
Endpoint is v1.0-only, or path is wrong | Retry with api_version='v1.0', or run search_graph_api again — 404s suggest related endpoints from the local index |
pip install fails on numpy/torch |
Resolver conflict or unsupported Python | Use Python 3.11+ in a clean virtualenv. numpy is pinned <2 for sentence-transformers compatibility |
Server has no attribute list_tools |
MCP 2.x was installed | Reinstall from this repo. GraphMind requires MCP 1.x (mcp>=1.27.1,<2) |
search_graph_api returns no results |
Filters too narrow | Broaden the query, drop tags/method, or set api_version='both' |
| MCP server not appearing in the client | Wrong cwd or command |
Launch from the repo root (cwd) so ./msgraph-metadata and .env resolve. Set command to the venv interpreter, then verify python -m graphmind.mcp.server runs with that same Python |
For a quick non-MCP sanity check, run python -m graphmind.cli stats (loads the index) and
python -m graphmind.cli search "list all users" (exercises the funnel) from the repo root.
GitHub Actions
.github/workflows/test.yml— runs on push/PR: compileall + pytest.github/workflows/refresh.yml— daily at 02:00 AEST, pulls latestmsgraph-metadata, diffs against the stored manifest, and commits changes. No auth secrets required for the spec refresh job.
Development
From the activated Quick Start virtual environment:
pip install -e ".[dev]"
python -m pytest tests/ -v
python -m compileall graphmind
Contributing & community
Contributions are welcome. Please read:
- CONTRIBUTING.md — dev setup, checks, branch/PR conventions
- CODE_OF_CONDUCT.md — community expectations
- SECURITY.md — how to report vulnerabilities (do not open a public issue)
- CHANGELOG.md — notable changes per release
Use the issue templates for bug reports and feature requests, and the pull request template when opening a PR.
License
GraphMind is released under the MIT License.
GraphMind MCP 질문
GraphMind MCP는 어떤 도구를 제공하나요?
9개 도구를 제공합니다. 예: search_graph_api, get_endpoint_schema, call_graph_api, get_changelog, paginate.
GraphMind는 AI 환각을 어떻게 방지하나요?
전체 Graph API에 대한 최신 로컬 인덱스를 유지하며, 3단계 검색 퍼널을 사용하여 자연어 쿼리에 대한 정확한 엔드포인트를 찾아냅니다.
처음 실행할 때 어떤 과정이 진행되나요?
OpenAPI 스펙을 파싱하는 데 4~6분 정도의 초기 구동 시간이 소요되며, 약 80MB 크기의 reranker 모델을 한 번 다운로드합니다.