sage-mcp
Provides tools for interacting with Sage Business Cloud Accounting API v3.1, enabling discovery of supported Sage collections and CRUD operations such as listing/searching, retrieving, creating, updating, and deleting accounting resources through OAuth-authenticated connections.
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., "@sage-mcpscaffold a new authenticated MCP server with persona-scoped connections"
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.
Sage Accounting MCP
Twynity-connected MCP server for Sage Business Cloud Accounting API v3.1. Each user connects with Sage OAuth; the Sage developer subscription key is shared app configuration. OAuth tokens are stored encrypted in MongoDB, and generic CRUD tools derive resource types and schemas from the checked-in Sage OpenAPI document.
Tool surface
sage_resources— discover supported Sage collections and their operations.sage_describe— inspect query parameters and create/update schemas before calling Sage.sage_list— list/search a resource using only documented Sage filters.sage_get— retrieve the full record by Sageid.sage_create/sage_update/sage_delete— generic writes parameterized by resource type. Delete requires explicit user confirmation.
The OpenAPI snapshot is app/data/sage_accounting_v3.1.openapi.json. This lets
the MCP resolve resource paths, valid query parameters, request wrappers, and
schemas without hand-maintained per-resource field lists. Sage operations that
are not standard CRUD (for example release/reissue actions) are not exposed by
these initial tools.
Related MCP server: yourco-mcp
Sage OAuth and Twynity contract
The manifest at GET /.well-known/mcp.json declares:
{"external_connections":{"oauth":{"provider":"sage"}}}Twynity uses these authenticated routes:
GET /api/v1/auth/sage/login?redirect_uri=...— validates the configured Twynity callback URI and redirects to Sage authorization.POST /api/v1/auth/sage/token-callback?redirect_uri=...&code=...— exchanges the authorization code and stores encrypted access/refresh tokens plus Sage'sresource_owner_id.POST /api/v1/auth/sage/logout— removes the saved tokens for the current user/persona.GET /api/v1/external-connection/me— returns connection status.
Every request from Twynity must include its verified bearer JWT and
Persona-Id. MongoDB scopes a connection to the exact (user_id, persona_id)
pair. Sage API calls send the access token in Authorization: Bearer ... and
the saved resource_owner_id in X-Site. Refresh tokens are used to renew
expired access tokens. The MCP does not return OAuth tokens to Twynity or the
model after exchange.
The OAuth app must register the exact Twynity callback URI. List the accepted
URI(s) in SAGE_OAUTH_REDIRECT_URIS; configure SAGE_OAUTH_TOKEN_URL for the
Sage app's region. The Sage developer portal also issues an API subscription
key when you subscribe the app to Sage Accounting. Configure it as
SAGE_SUBSCRIPTION_KEY; the server sends it as Ocp-Apim-Subscription-Key on
Sage API requests. This is an app-level secret, not a per-user credential. The
example .env.example token endpoint is for UK/GB and must be checked against
the actual Sage developer app.
Local setup
Copy
.env.exampleto.envand set Sage OAuth credentials/URLs, Twynity account-service and license settings, MongoDB, and public URL.Generate a Fernet key:
uv run python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"Keep
ENCRYPTION_KEYstable and secret; changing it makes stored OAuth tokens unreadable.Install, build the starter MCP App bundle, and test:
uv sync --locked cd app/ui/say_hello && npm ci && npm run build && cd ../../.. uv run pytest -q uv run ruff check app testsStart the service:
uv run uvicorn app.main:app --host 0.0.0.0 --port 8000
The UI directory is retained from the starter scaffold; it is not currently attached to the Sage CRUD tools. Docker builds the UI bundle as part of its multi-stage build.
This server cannot be deployed
Maintenance
Related MCP Connectors
Build multi-tenant apps over MCP. Schemas, CRUD, deploys — access control enforced server-side.
The official MCP Server from Mia-Platform to interact with Mia-Platform Console
A MCP server built for developers enabling Git based project management with project and personal…
MCP server for mandates, delegation, policy-gated execution, credential grants, and audit.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables developers to scaffold secure-by-default MCP servers with deny-all permissions, typed tool stubs, and pre-wired audit hooks, while enforcing security posture through CI.3 npmMIT
- FlicenseNot gradedqualityBmaintenanceEnables developers to build MCP servers with registry-managed tool metadata, runtime hot-reloading, pluggable authentication and authorization, per-audience tool views, and resilient stateless operation.-
- AlicenseNot gradedqualityCmaintenanceEnables deploying production-ready MCP servers with built-in authentication, rate limiting, data desensitization, audit logging, and session isolation, ready for Kubernetes.MIT
- AlicenseNot gradedqualityBmaintenanceEnables developers to scaffold production-ready MCP servers with typed tools, resources, prompts, transports, authentication, and database integrations.MIT