NIM Key Manager MCP Server
Enables Claude to manage NVIDIA API keys through an OAuth-secured MCP connector, including listing, dispensing, rotating, and revoking keys with RBAC and audit trail.
README
NIM Key Manager
<img width="1200" height="630" alt="NIM-KE~1" src="https://github.com/user-attachments/assets/1dc02b55-1a6d-41ff-a76b-14abb53a853d" />
Self-hosted, production-ready manager for the API keys of your own NVIDIA Build/NIM account — encrypted storage, assisted rotation, expiry detection, usage stats, projects, RBAC, audit, a web dashboard, and a Claude MCP connector. Deploy your own instance in a few minutes; everything is configured through environment variables.
NVIDIA Terms of Service. NVIDIA Build offers no public API to create or rotate keys programmatically (you generate them at build.nvidia.com), and API keys must not be shared or redistributed to third parties. This project is therefore designed for you to manage your own keys on your own instance: the only outbound call is the official read-only validation endpoint
GET https://integrate.api.nvidia.com/v1/models. It does not automate or scrape the NVIDIA portal, and it is not a service for handing your keys to other people.
Deploy your own (no local setup)
- Click the button (or Use this template → Create repository, then in Render pick New → Blueprint and select your fork). Render reads
render.yamland provisions everything automatically:- a managed PostgreSQL database,
- the Dockerized web service with a health check,
- the secrets
JWT_SECRET,ENCRYPTION_MASTER_KEYandMCP_OAUTH_JWT_SIGNING_KEY(generated and stored by Render's secret manager), DATABASE_URLinjected from the database.
- When prompted, set
FIRST_ADMIN_EMAILandFIRST_ADMIN_PASSWORD(your initial admin, created on first boot). - Open the service URL: log in at
/, explore the API at/docs. - Every push to
mainruns CI (lint + types + tests + build) and redeploys automatically. Migrations (alembic upgrade head) run on container start.
Prefer another host? Any platform that runs a Docker container + PostgreSQL works — see docs/deployment.md.
Use it from Claude (MCP connector)
The same deployment exposes a Model Context Protocol server at ‹BASE›/mcp so you can add it to Claude as a custom connector. Claude authenticates with OAuth 2.1 (GitHub by default, Google optional) and can list/inspect keys, dispense a ready-to-use key, register/rotate/revoke and manage projects — with the same RBAC and audit trail as the REST API. Only identities in MCP_ALLOWED_IDENTITIES may connect (fail-closed).
- Create a GitHub OAuth App with callback
‹BASE›/auth/callback; copy the Client ID/Secret. - In Render set
MCP_GITHUB_CLIENT_ID,MCP_GITHUB_CLIENT_SECRETandMCP_ALLOWED_IDENTITIES(your GitHub login/e-mail). The rest is already inrender.yaml. - In Claude: Settings → Connectors → Add custom connector → URL
‹BASE›/mcp→ Connect.
Full guide (Google, tool reference, security, troubleshooting): docs/connector.md.
Features
- Secure key registration — encrypted at rest with AES-256-GCM (key derived via HKDF-SHA256 from the platform secret manager). Never stored or logged in plaintext.
- Assisted, audited rotation — you create the new key in your NVIDIA account, paste it, and the system performs an atomic swap (new key active, old one revoked with a
rotated_from_idlineage link). - Expiry detection — hourly background job + maintenance endpoint; configurable
expiring_soonflag. - Periodic validation — automatic sweep against NVIDIA every 6 h (configurable) that flags invalid/revoked keys.
- Key dispensing —
GET /api/v1/keys/dispensereturns the least-recently-used active key (LRU), globally or per project, recording usage. - Projects — group keys by consumer/workload.
- Statistics — inventory by status, dispenses, usage time series.
- Security — JWT (access + refresh), roles
admin/manager/viewer, rate limiting, immutable audit of every sensitive operation. - Claude connector (MCP) — OAuth-secured MCP server at
/mcp(see above). - Operations — structured JSON logging, Prometheus metrics at
/metrics, health check at/health, OpenAPI at/docs.
Architecture
app/
├── domain/ # Enums and domain exceptions (no dependencies)
├── application/ # Use cases (services) and ports (interfaces)
│ └── services/ # auth, users, keys, projects, stats, audit
├── infrastructure/ # Adapters: SQLAlchemy (repositories) and NVIDIA gateway
├── api/ # FastAPI: routers, schemas, deps, rate limiting
├── mcp/ # Claude connector: MCP server, OAuth and identity mapping
├── dashboard/ # Lightweight SPA served at /
├── tasks/ # Scheduled jobs (APScheduler)
└── core/ # Config, crypto, security, logging
Pragmatic Clean Architecture: dependencies point inward; the application layer knows nothing about FastAPI and reaches NVIDIA through the KeyValidator port. Details and decisions in docs/architecture.md.
Stack: Python 3.12 · FastAPI · FastMCP (Claude connector) · SQLAlchemy 2 (async) · managed PostgreSQL · Alembic · Docker · GitHub Actions · Render (Blueprint) · structlog · Prometheus · slowapi · APScheduler.
API quickstart
BASE=https://your-service.onrender.com
# Log in (the admin was created on first boot)
TOKEN=$(curl -s $BASE/api/v1/auth/login -H 'Content-Type: application/json' \
-d '{"email":"you@example.com","password":"your-password"}' | jq -r .access_token)
# Register a key created at build.nvidia.com (validating it against NVIDIA)
curl -s $BASE/api/v1/keys -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{"name":"prod-1","api_key":"nvapi-...","validate_remote":true}'
# Get an available key (LRU) to use in your application
curl -s "$BASE/api/v1/keys/dispense" -H "Authorization: Bearer $TOKEN"
More examples (rotation, projects, stats, audit) in docs/api-examples.md. Interactive OpenAPI at /docs.
Roles
| Operation | viewer | manager | admin |
|---|---|---|---|
| View keys, projects and stats | ✅ | ✅ | ✅ |
| Register / validate / rotate / revoke / dispense keys | ❌ | ✅ | ✅ |
| Manage projects | ❌ | ✅ | ✅ |
| Delete keys, manage users, read the audit log | ❌ | ❌ | ✅ |
Development & tests
Not required to deploy, but fully supported:
pip install -e ".[dev]"
pytest --cov=app # required coverage gate: 85% (currently ~94%)
ruff check . && mypy app
docker compose up # local stack with PostgreSQL
Security
Threat model, cryptographic details and design decisions in docs/security.md. Key points: AES-256-GCM encryption with a key derived (HKDF) from the secret manager, SHA-256 fingerprints to deduplicate without exposing the secret, short-lived signed JWTs, argon2 password hashing, per-IP rate limiting, audit of every sensitive operation, and no plaintext keys in logs or responses except the explicit dispense endpoint. To report a vulnerability, see SECURITY.md.
Contributing
Contributions are welcome — see CONTRIBUTING.md and the Code of Conduct. A short Spanish overview is available in README.es.md.
License
MIT — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。