
altinn auth mcp
一个兼容 FastMCP 的模型上下文协议 (MCP) 服务,用于生成企业、个人和授权令牌。
Repository Info
About This Server
一个兼容 FastMCP 的模型上下文协议 (MCP) 服务,用于生成企业、个人和授权令牌。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
🔐 Altinn Auth MCP
A FastMCP-compatible Model Context Protocol (MCP) service that wraps the Altinn TestTools Token Generator, exposing standardized tools for generating:
- Enterprise (Maskinporten-style) tokens
- Personal (ID-porten-style) tokens
- Consent tokens for domain services
This MCP is designed to be consumed by other MCPs that require authentication in test environments like tt02, at24, or none.
📎 How to Use as an MCP Client
Any other MCP can declare this Auth MCP as its token provider via the auth block.
🔧 Example: Declaring in a Service MCP
"auth": {
"required": true,
"provider": "altinn-auth-mcp",
"method": "get_enterprise_token",
"scopes": ["altinn:dataaltinnno/ebevis"],
"params": {
"env": "tt02",
"orgNo": "991825827",
"org": "digdir"
}
}
🔁 The calling MCP or agent must resolve this auth provider and invoke the tool before calling the protected API.
🧪 Example: Manual Token Call via Cascade
Once registered in Windsurf, you can directly invoke token generation:
cascade altinn-auth-mcp.get_enterprise_token \
--env tt02 \
--scopes altinn:dataaltinnno/ebevis \
--orgNo 991825827
Response:
{
"status": "success",
"token": "eyJhbGciOi..."
}
🧩 Available Tools
| Tool | Description |
|---|---|
get_enterprise_token | Generate enterprise JWT using org/orgNo |
get_personal_token | Generate personal token using PID/user info |
get_consent_token | Generate consent token for a dataset |
🧰 Registering in Windsurf
Add to your mcp_config.json:
"altinn-auth-mcp": {
"command": "python",
"args": ["server.py"],
"env": {
"MCP_AUTH_USERNAME": "your-username",
"MCP_AUTH_PASSWORD": "your-password"
}
}
Then run:
windsurf up
The auth MCP will be available for use in other MCPs and for direct token generation via CLI or assistants.
📦 Environments Supported
tt02at24none(uses internal signing keys for high-performance local use)
🧾 Notes on @context
This MCP includes the following field in its JSON-LD metadata:
"@context": "https://altinn.dev/mcp/context"
Disclaimer: This URI currently acts as a placeholder and is not publicly resolvable.
It is included for the following reasons:
- To indicate that this MCP follows a consistent structure defined by the Altinn R&D Lab.
- To support future compatibility with JSON-LD tools, schema validators, and intelligent agents.
- To enable eventual publication of a semantic MCP vocabulary shared across Altinn services.
You can safely ignore or stub this context reference in local tools. It is not required for core functionality.
Made with ❤️ by the R&D AI lab at Digdir
Quick Start
Clone the repository
git clone https://github.com/nlundee/altinn-auth-mcpInstall dependencies
cd altinn-auth-mcp
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.