
mcp
org.niiko/mcp
Act on a niiko workspace: CRM, scheduling, billing and the WhatsApp agent, with OAuth consent.
Documentation
niiko-mcp-server
The remote MCP server of niiko. Connect Claude — or any MCP client that speaks OAuth — and every action and read you grant becomes a tool.
The server does not live in this repository, on purpose. It runs inside the niiko application
(apps/web/app/api/mcp), because the token is validated by the same identity system that signs people in —
a server in another process would turn a permission boundary into a network call. What this repository is: the
door. How to connect, which tools there are, and where to report something. Generated from the same plan as the
SDKs (plan 652f48a0c4ff; reads plan 3f80df17e901).
Connect
https://niiko.org/api/mcp
| Transport | MCP over HTTP (Streamable HTTP), protocol 2025-06-18. |
| Authentication | OAuth 2.1 with dynamic client registration and PKCE. Discovery at https://niiko.org/.well-known/oauth-authorization-server. Any MCP client that speaks OAuth registers itself. |
| Consent | Always through a niiko screen where the person picks one workspace, which actions and which reads to grant (two separate blocks) — one by one, none checked by default. A token is one person × one workspace × the actions ticked. What the client asks for in scope is informational; what it receives is what was ticked. |
| Revocation | Settings → Developers → Apps. Immediate. |
Claude
In Claude (Desktop, web or Code): Settings → Connectors → Add custom connector, paste the URL above, and follow the consent screen. In Claude Code:
claude mcp add --transport http niiko https://niiko.org/api/mcp
[!IMPORTANT] Besides the authorization, every action needs the workspace owner to have switched it on in Settings → Connections, column “API & MCP”. Authorizing a client switches nothing on — they are two decisions made by different people.
How it answers
Every tool returns JSON text with one of three outcomes:
status | Meaning |
|---|---|
done | The action happened. output carries the result. |
refused | It did not happen. reason names why and detail.message says what to do — the candidates of an ambiguous name, the stages that do exist, why a template is not valid. |
pending_approval | It is waiting for a human signature. Do not retry. |
This server exposes verbs and a few declared reads, never tables: a model can ask how much is owed, what was
collected this month, how the funnel or the calendar look, or a client's invoices — but it cannot list or export
records, and it never reads conversations, notes or tasks. Reads answer with what the person who authorized the
app can see on their own screen, and they change nothing (readOnlyHint).
The tools today (27)
| Tool | Action | What it does |
|---|---|---|
miira_lead_create | miira.lead_create | Creates a new lead in the workspace CRM from its contact details. If a matching one already exists it is not duplicated: the reply is ambiguous with the candidates. |
crm_call_logged | crm.call_logged | Logs what was discussed in a call on a client's record, naming the client; optionally creates the follow-up with its date. Reads nothing and calls no one. |
crm_owner_assigned | crm.owner_assigned | Changes who owns a client, naming the client and the team member (by name or email). If either is ambiguous it refuses with the list. |
crm_stage_moved | crm.stage_moved | Moves a client's open deal to another pipeline stage, naming the client and the stage. Creates no deals: with no open deal it refuses, and with several it refuses with the list. |
kiipu_invoice_proposed | kiipu.invoice_proposed | Prepares an invoice as a DRAFT for a client named by name, with its lines and taxes. Does NOT issue it, does NOT number it and does NOT count as debt: a person reviews and issues it in Kiipu. Does not create the client if it does not exist. |
crm_task_created | crm.task_created | Creates a reminder (a task with date and time) on a client named by name. Does not log a call: that is crm.call_logged. Does not create the client if it does not exist. |
crm_deal_created | crm.deal_created | Opens a new deal in the pipeline for a client named by name, with a title, an optional value in USD, an optional stage (by name; without it, the first one) and an optional owner. Does not check for other open deals: it returns how many remain so a duplicate is visible. Does not win or lose it: that is crm.stage_moved. |
crm_note_added | crm.note_added | Saves a note on a client's record, naming the client: something to know next time, with no call and no date. For a call use crm.call_logged; for a dated reminder, crm.task_created. |
crm_contact_added | crm.contact_added | Adds a person (name, and optionally email, phone and role) to a client's record, naming the client. Does not make them the primary contact and does not create the client. If someone with that email or phone already existed, the reply says so but does not block it. |
miira_broadcast_quoted | miira.broadcast_quoted | Quotes sending the SAME WhatsApp message to several clients named by name (up to 50). Sends NOTHING: per client, it says whether the text goes as-is (24-hour window open; free up to 1,000 a month per number, then Meta's service rate), whether an approved template is needed and what it costs, or why that client cannot be messaged. Returns a signed quote valid for 15 minutes; sending is a separate action, miira.broadcast_sent, which takes this quote. Optional purpose: notice (default) is the usual notice; promotion NEVER sends free text, even with the window open, and requires an approved MARKETING template (otherwise plantilla_invalida): it only reaches clients with granted marketing consent (no_marketing_consent otherwise) and leaves US numbers out (us_moratorium). In a promotion message is never sent: what goes is the template with its templateValues. promotion is meant for offers and campaigns; replies and notices are notice. |
miira_broadcast_sent | miira.broadcast_sent | Sends the WhatsApp broadcast quoted by miira.broadcast_quoted, exactly to whom and how the quote said. If anything changed (window, consent, rate) it refuses with a new quote to confirm again. Costs money when templates are involved: the cost is the one shown in the quote. |
kiipu_draft_voided | kiipu.draft_voided | Voids a DRAFT invoice (one created with kiipu.invoice_proposed and not yet issued), by its id or by the client's name when it is their only draft. Does not void issued invoices: that is for a person in Kiipu. |
kiipu_payment_reported | kiipu.payment_reported | Leaves in the Kiipu approval queue the notice that a client (by name) paid a given amount of an open invoice. Does NOT apply the payment and touches no balances: a person checks it against the bank and applies it. If the client has several open invoices the number must be given. |
Reads (14)
Read-only. OAuth only — an API key has no person behind it and gets reads_need_a_person — and each one also
needs the workspace owner to have switched it on.
| Tool | Read | What it returns |
|---|---|---|
crm_clients_search | crm.clients_search | Counts and finds the workspace's CRM clients, optionally by part of the name, status, tag or creation date. Returns the total, the total per status and up to 15 clients with status, owner and creation day. No contact details and no notes. |
kiipu_collections_get | kiipu.collections_get | Reads what is owed: the outstanding total, what is overdue by age bucket, the 15 clients who owe the most with their overdue amount and since when, and the next installments due. Changes nothing and contacts no one. |
kiipu_collected_month_get | kiipu.collected_month_get | Reads how much was collected this month so far (as the ledger recorded it), the same stretch of last month to compare, and what is still outstanding. Does not say who owes: that is kiipu.collections_get. |
kiipu_client_invoices_list | kiipu.client_invoices_list | Lists the latest invoices and payments of ONE client named by name: number, status, total, balance, and when and how they paid. With several matches it refuses with ambiguous and the candidates; with none, not_found. |
miira_conversations_waiting_get | miira.conversations_waiting_get | Reads how many conversations a team member is handling, how many are waiting for a reply, how many have waited longer than the workspace threshold and the longest wait. Counts only: no names and no messages. |
ciita_agenda_get | ciita.agenda_get | Reads the appointments of today, this week, next week or this month: how many per status and the first 15 with day, time in the workspace time zone, client, resource and status. Books nothing. |
miira_funnel_get | miira.funnel_get | Reads the Miira lead funnel by stage (the same rule as the board), how many leads are qualified, how many came in this month and the 15 most recent with their stage. Clients who already bought are in the CRM, not here. |
kiipu_month_result_get | kiipu.month_result_get | Reads this month's income statement from the ledger: revenue, expenses, net income, the accounts that weigh most and last month to compare. If the ledger does not balance right now it gives no figures; with no entries it says so, never zero. |
crm_month_summary_get | crm.month_summary_get | Reads how the month is going, piece by piece and with the same figures each read would give: new clients, collected, proposals sent and accepted, deals won, appointments and the ledger result. A piece the person's role does not see, or whose read is off, comes back in unavailable. |
miira_catalog_search | miira.catalog_search | Searches the published catalog by words and returns up to 5 active public offerings with name, summary, price, currency and what the price is per; with exactly one match, also its whole description and attributes. Internal, paused and discontinued offerings never come back. |
miira_knowledge_search | miira.knowledge_search | Searches the knowledge base the team loaded for the sales agent (manuals, cases, answers to objections) by words, and returns up to 6 fragments with their document and section. Only active documents that finished indexing. It is not the source of a price: that is miira.catalog_search. |
kiipu_client_balance_get | kiipu.client_balance_get | Reads how much ONE client named by name owes in total, as the ledger has it, and their next installment due. A client never invoiced comes back as never_invoiced, never as up to date; a lead or a churned client, as not_a_client. With several matches it refuses with ambiguous; with none, not_found. |
crm_client_overview_get | crm.client_overview_get | Reads where ONE client named by name stands: their open invoices with balance and since when they are owed, the total owed, and which channels you have talked on with the day of their last message. Never what was said, and no phone or email. |
miira_agent_config_get | miira.agent_config_get | Reads how the sales agent is configured today: its persona, the script in order with what each question saves and scores, the funnel stages, the reference responses, the documents asked per client type and the milestones. With configured: false the workspace still has the demo setup. Changes nothing. |
The full catalog, with the input schema of each tool exactly as the server announces it, is in
tools.json. The API behind it: developers.niiko.org.
What it does not do
| Not included | Why |
|---|---|
| Run locally | The token is validated by niiko's identity system; a local copy would have to be trusted with it. Connect to the remote server. |
| Resources or prompts | Only tools. Data stays in the workspace, and the person's screen is the resource. |
| API keys | The MCP server authenticates people, through OAuth. Integrations that hold an nk_… key use the SDKs or the CLI. |
Support
| Versioning | Semantic. Every visible change is in the changelog of the API reference. |
| Regeneration | This repository is generated from the niiko action manifest. When an action opens or a contract changes, a new version is published — nothing here is edited by hand. |
| Issues | vorluno/niiko-mcp-server/issues — a fault of the API itself starts at developers.niiko.org. |
| Security | security@vorluno.dev — first response within 48 hours, patch or plan within 7 days. |
| Issues here are open | This is the place for anything that happens while connecting an MCP client. What belongs to an action's contract is fixed at the source and linked from here. |
Related
- @vorluno/niiko-sdk — the TypeScript client, same plan.
- niiko (Python) — the Python client, same plan.
- niiko-cli — the same actions from the terminal.
- n8n-nodes-niiko — the same actions as an n8n node, also usable as an AI Agent tool.
- developers.niiko.org — the API reference this is generated alongside.
Built and maintained by Vorluno, a software studio in Panama, and generated from niiko's production action manifest — the same one the server enforces. MIT.
No installation packages available.