MCP Server
The Optare MCP Server (@optare/mcp-server) enables AI agents like Claude to interact with Optare ID.
What is MCP?
Model Context Protocol (MCP) (opens in a new tab) is a standard for connecting AI models to external tools and data sources.
With the Optare MCP Server, AI agents can:
- Authenticate users
- Check permissions
- Manage organizations
- Query user data
Installation
NPM
npm install @optare/mcp-serverDocker
docker pull optare/mcp-serverConfiguration
Environment Variables
OPTARE_DOMAIN=https://id.optare.one
OPTARE_API_KEY=your_api_keyClaude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"optare": {
"command": "npx",
"args": ["@optare/mcp-server"],
"env": {
"OPTARE_DOMAIN": "https://id.optare.one",
"OPTARE_API_KEY": "your_api_key"
}
}
}
}Available Tools
Authentication
| Tool | Description |
|---|---|
get_current_user | Get authenticated user info |
verify_token | Validate an access token |
check_permission | Check if user has permission |
Users
| Tool | Description |
|---|---|
list_users | List users in organization |
get_user | Get user by ID |
search_users | Search by email/name |
Organizations
| Tool | Description |
|---|---|
list_organizations | List all organizations |
get_organization | Get org details |
list_members | List org members |
Licenses
| Tool | Description |
|---|---|
check_license | Check feature access |
get_entitlements | List all entitlements |
Example Usage
In Claude
User: "Who are the admins in Acme organization?"
Claude: I'll check the members of Acme organization.
[Uses list_members tool with org_id="acme"]
The admins in Acme organization are:
- John Doe (john@acme.com)
- Jane Smith (jane@acme.com)Programmatic
import { OptareMCPServer } from '@optare/mcp-server';
const server = new OptareMCPServer({
domain: process.env.OPTARE_DOMAIN!,
apiKey: process.env.OPTARE_API_KEY!,
});
// Start SSE mode for web
await server.startSSE(3000);
// Or stdio mode for Claude Desktop
await server.startStdio();Resources
The MCP server also provides resources:
| Resource | URI |
|---|---|
| User profile | optare://users/{userId} |
| Organization | optare://orgs/{orgId} |
| Subscription | optare://subscriptions/{subId} |
Security
- API key is required for all operations
- Operations are scoped to API key permissions
- Audit logs track all MCP operations
Next Steps
- Management SDK - Programmatic admin
- Webhooks - Event notifications