Integrations · MCP
Use Nefin in Cursor, VS Code and Gemini CLI
Nefin runs an MCP server, so the AI in your editor or terminal can work with your books directly. Ask for a report, look up who owes you, or draft an invoice without leaving your tools. It acts as you and can do only what you can do.
Before you start
- Cursor, VS Code or Gemini CLI installed. For VS Code you use Nefin from Copilot Chat in agent mode.
- A Nefin account with two-step verification. If you haven’t set it up, Nefin walks you through it the first time you connect.
- AI switched on for at least one company. An owner turns it on in Settings → Company. The AI can only reach companies where AI is on.
- The Professional or Business plan in Nefin. Starter companies show up as locked, with an upgrade link.
Each app below has a sign-in setup with no token to copy. If sign-in is not an option where you work, see Use a token instead.
Cursor
Add the server
Create .cursor/mcp.json in your project, or ~/.cursor/mcp.json to use Nefin in every project, with this content:
{
"mcpServers": {
"nefin": {
"url": "https://api-books.nefin.app/mcp"
}
}
}You can also add a server from Cursor’s MCP settings (in the Customize sidebar) and paste the URL there.
Sign in
Open Cursor’s MCP settings and find nefin. Click the button to connect or sign in. Your browser opens Nefin. Sign in as usual, including your two-step code, check the companies and what the AI may do, and click Allow access. The connection is read-only unless you turn on Allow changes.
VS Code
Add the server
Create .vscode/mcp.json in your workspace with this content:
{
"servers": {
"nefin": {
"type": "http",
"url": "https://api-books.nefin.app/mcp"
}
}
}Start it and sign in
Start the nefin server from the MCP servers list in VS Code. When it asks you to sign in, your browser opens Nefin. Sign in, check the companies and click Allow access.
Use it in Copilot Chat
Open Copilot Chat and switch to agent mode. Select the Configure Tools button in the chat box to see the Nefin tools. Switch off the ones you don’t want the AI to use.
Gemini CLI
Add the server
Add Nefin to ~/.gemini/settings.json, or to .gemini/settings.json in a project to keep it there:
{
"mcpServers": {
"nefin": {
"httpUrl": "https://api-books.nefin.app/mcp"
}
}
}Gemini CLI uses httpUrl for servers like Nefin’s. Its url setting is for the older SSE kind.
Sign in
Start gemini and run:
/mcp auth nefin
Your browser opens Nefin. Sign in, check the companies and click Allow access. If Gemini CLI asks you to sign in again later, run /mcp auth nefin once more.
Use a token instead
Where no browser can open, or where your app can’t complete the sign-in, use a personal token.
Create a token
In Nefin, open Account → AI connectors and click Create token. Tokens are read-only unless you turn on Allow changes, and expire after 90 days unless you pick another lifetime. Copy it right away, because Nefin shows it only once.
Put it in the config
Cursor
{
"mcpServers": {
"nefin": {
"url": "https://api-books.nefin.app/mcp",
"headers": {
"Authorization": "Bearer <your-token>"
}
}
}
}VS Code
{
"servers": {
"nefin": {
"type": "http",
"url": "https://api-books.nefin.app/mcp",
"headers": {
"Authorization": "Bearer <your-token>"
}
}
}
}Gemini CLI
{
"mcpServers": {
"nefin": {
"httpUrl": "https://api-books.nefin.app/mcp",
"headers": {
"Authorization": "Bearer <your-token>"
}
}
}
}A token has the same access as you. Treat it like a password, keep it out of any file you commit, give each machine its own, and revoke any you no longer use.
Try it
Ask in plain language:
- “List my Nefin companies.”
- “Which invoices in Acme Ltd are overdue, and who owes the most?”
- “In Acme Ltd, run the profit and loss for last quarter and compare it with the quarter before.”
- “In Acme Ltd, draft an invoice for Bardhi SHPK: 10 hours of consulting at 45.00, standard VAT.”
- “In Acme Ltd, show me every bill from Bardhi SHPK this year and the total we paid.”
- “Get Nefin's guide for bank statements, then reconcile this statement for Acme Ltd.”
- “Get Nefin's guide for payroll, then show me last month's payroll run in Acme Ltd.”
Start with the company, such as “in Acme Ltd, …”. If you have only one company, The AI picks it for you. If you have several and don’t say which, The AI asks you before it does anything.
Every answer says which company it used and links to the record in Nefin, so you can check it in one click.
Bigger jobs take several steps in a fixed order. Nefin keeps those steps in short guides that The AI reads on demand with the get_guide tool. Nefin tells The AI to fetch one before bank statement, payroll or tax payment work, and you can ask for one yourself. The AI then follows the guide instead of guessing the order. The guides are:
bank_statements: importing a bank statement and reconciling itpayroll: running payrolltax_payments: paying income tax, pension, VAT or a tax debterrors: what to do when Nefin refuses something
For example: “Get Nefin’s guide for bank statements, then reconcile this statement for Acme Ltd.”
Amounts go in and come back as exact decimals, such as "1234.56", so nothing gets rounded along the way.
What the AI can do
Nefin gives the AI 26 tools. Each one works in one company at a time, so name the company in your request. With one company the AI uses it automatically. With several, it asks which one you mean.
Read
Never changes anything.| list_companies | See the companies you can work in and your role in each |
| get_guide | Read the step-by-step guide for a bigger job, such as a bank statement or payrolltopic: bank_statements · payroll · tax_payments · errors |
| run_report | Run a financial report, such as profit and loss, balance sheet or agingtype: trial-balance · profit-loss · balance-sheet · aging-receivable · aging-payable · general-ledger · tax-summary · cash-flow · budget-vs-actuals · cash-projection · sales-book · purchase-book |
| search_records | Find a contact, document, item or account by name or number |
| list_contacts | List customers and vendors with what they owe or are owed, or open onetype: customer · vendor |
| list_documents | List invoices and bills, or open one with its lines and paymentsdocType: invoice · bill |
| list_setup | List your accounts, items, VAT rates and stock levelskind: account · item · vat_rate · stock_level |
| list_journals | List journal entries, optionally for a date range or status |
| list_payments | List payments received and paid, including drafts waiting to be connected |
| list_bank_accounts | List your bank accounts with their balances and open statement lines |
| list_bank_transactions | List imported bank statement lines and whether each one is matched |
| get_bank_reconciliation | Check a bank account against its statement and see what explains the difference |
| get_payroll | Read salaries, adjustments, payroll runs and payslips, or calculate a salary |
Create and update drafts
Records and drafts. Nothing reaches the ledger yet.| save_contact | Add a customer or vendor, or update an existing onetype: customer · vendor · both |
| create_setup | Add a ledger account, an item or a VAT ratekind: account · item · vat_rate |
| create_document | Create a draft invoice or billdocType: invoice · bill |
| import_bank_statement | Import bank statement lines for matching; nothing is posted yet |
| set_salary | Set or change how an employee is paid |
Post, correct or delete
Flagged as destructive, so the AI app should confirm with you first.| update_document | Change an invoice or bill; new lines on an activated one reverse and re-post its entrydocType: invoice · bill |
| delete_document | Delete a draft or void invoice or billdocType: invoice · bill |
| activate_document | Finalize a draft invoice or bill and post it to the booksdocType: invoice · bill |
| record_payment | Record a payment received or paid and apply it to invoices or bills |
| manage_journal | Create a manual journal entry as a draft, or post a draft to the books |
| reconcile_bank_lines | Book imported statement lines as payments, transfers, fees or journal entries |
| mark_bank_period_reconciled | Mark a bank account as reconciled up to a statement date and lock that period |
| run_payroll | Create, approve and pay a payroll run, and manage recurring payroll adjustments |
Tools that were renamed
Old names keep working for now, so saved prompts and scripts don’t break. Permissions and allowlist entries belong to a tool’s name, so set them again on the new tool.
- get_contact → list_contacts
- get_document → list_documents
- list_accounts → list_setup
- list_items → list_setup
- list_vat_rates → list_setup
- list_stock_levels → list_setup
- list_draft_payments → list_payments
- create_contact → save_contact
- update_contact → save_contact
- create_account → create_setup
- create_item → create_setup
- create_vat_rate → create_setup
- create_invoice → create_document
- create_bill → create_document
- update_invoice → update_document
- update_bill → update_document
- delete_invoice → delete_document
- delete_bill → delete_document
- send_invoice → activate_document
- receive_bill → activate_document
- create_journal → manage_journal
- post_journal → manage_journal
- connect_draft_payment → record_payment
Staying in control
- Read-only by default. The consent screen has an Allow changes switch that starts off. Leave it off and the AI can look things up and run reports but cannot create or change anything.
- Your permissions, nothing more. The AI works as you in each company. If your role can’t post journals, neither can it.
- Everything is on the record. Changes appear in the audit log under your name.
- The app asks first. Cursor, VS Code and Gemini CLI ask before they run a tool unless you tell them to trust it. Trust only tools that read, and keep approving the ones that post to the ledger one at a time.
- Turn off what you don’t need. Each app lets you switch tools off. To let the AI read and prepare drafts but never post, turn off every tool that posts, corrects or deletes:
update_document,delete_document,activate_document,record_payment,manage_journal,reconcile_bank_lines,mark_bank_period_reconciledandrun_payroll.
To cut off access, go to Account → AI connectors and click Disconnect next to the app, or Revoke next to a token. It takes effect immediately. Then remove the server from the config file.
Limits in each AI app
Every AI app has its own limits. This table shows what each one means for Nefin and what to do about it. The apps on this page are first.
| AI app | Tool names | Long instructions | Signing in | Approving actions | After a change |
|---|---|---|---|---|---|
| Cursor, VS Code, Gemini CLI | Cursor loads about 40 tools across all connected servers and drops the rest. Turn off Nefin tools you don't use, or other servers. VS Code and Gemini CLI have no such cap for Nefin. | Nothing to work around. For a long job, ask the agent to get Nefin's guide first. | Add the server URL and sign in when the app opens Nefin in your browser. A personal token in the headers works in all three. | Each app asks before it runs a tool unless you told it to trust or auto-run that tool. Leave that off for the tools that post. | Toggle the server off and on in Cursor or VS Code, or restart Gemini CLI, after anything changes. |
| Claude apps | Nothing to set. Tool names are capped at 64 characters and every Nefin tool name fits. | Nothing to work around. For a long job, ask Claude to get Nefin's guide first. | Choose Register automatically when you add the connector. Do not pick Use Claude's published identity, which Nefin does not support yet. | Set each Nefin tool to Always allow, Needs approval or Blocked in Customize, Connectors. | Start a new chat after anything changes. Each conversation keeps the tool list it started with. |
| Claude Code | No limit to manage for Nefin's tools. | Server instructions and each tool description are cut at 2 KB, so Nefin keeps long workflows behind get_guide. Ask Claude to get the guide before a big job. | Run /mcp, choose nefin and pick Authenticate. Where no browser can open, send a personal token in the Authorization header instead. | Claude Code asks before each tool you have not allowed. Allow the ones you trust in .claude/settings.json. | Run /mcp and reconnect nefin after anything changes. A running session keeps the tool list it started with. |
| ChatGPT | Nothing to set for Nefin's tools. | Nefin keeps its most important rules in the first 512 characters of its instructions and puts long workflows behind get_guide. Ask ChatGPT to get the guide before a big job. | Choose OAuth and leave the client ID and secret empty, so ChatGPT registers itself with Nefin. | ChatGPT asks you to confirm actions that change data. Nefin marks its read tools as read-only, so lookups run without a prompt. | Refresh the app in ChatGPT's connector settings after anything changes, then start a new chat. |
| Gemini | Gemini Enterprise recommends at most 100 enabled actions per server, well above what Nefin has. | No cut-off is documented. For a long job, ask Gemini to get Nefin's guide first. | Nefin registers the app for you where the console supports it. Where it asks for a client ID and secret, register one with the command in the guide. | The connection is read-only unless you turn on Allow changes when you connect. Check what Gemini proposes before you approve a change. | Disconnect and reconnect Nefin in the app's settings after anything changes. |
Troubleshooting
- Cursor shows fewer Nefin tools than expected
- Cursor counts about 40 tools across every connected server and drops the rest. Nefin has 26, so with a few other servers connected some of them disappear. Turn off Nefin tools you don't use, or turn off other servers, in Cursor's MCP settings.
- The server shows as needing sign-in or as disconnected
- You haven't signed in yet, or your session lapsed after 30 days without use. In Cursor click the sign-in button next to nefin. In VS Code start the server from the MCP list and sign in when it asks. In Gemini CLI run /mcp auth nefin.
- The app asks for a client ID
- Nefin registers the app itself, so no client ID is needed. If your version of the app still insists on one, use a personal token instead (see the token section above).
- The Nefin sign-in page says AI features are not enabled
- None of your companies has AI switched on. Ask an owner to turn it on in Settings, Company, then try again.
- The AI says it can't find a company
- The AI only sees companies where AI is on and where you are an active member. Ask it to list your Nefin companies to see exactly what it can reach.
- The AI asked which company to use
- You belong to more than one company, so it asks before it does anything. Name one, for example "in Acme Ltd, ...". With only one company it picks it for you.
- The AI doesn't see a tool or uses an old tool name
- A session keeps the tool list it started with. Toggle the server off and on in Cursor or VS Code, or restart Gemini CLI, then start a new chat.
- A change was refused
- The connection is read-only unless you turned on Allow changes when you connected. To change that, disconnect it under Account, AI connectors, and connect again with Allow changes on. Your role in the company must also allow the action.
- Nothing works with a token
- Check that the header is exactly Authorization: Bearer nef_pat_... and that the token hasn't been revoked or expired. Create a new token under Account, AI connectors, if in doubt.
Using a different AI app?
The same server works elsewhere. Nefin has a setup guide for Claude apps, Claude Code, ChatGPT and Gemini. See all of them on the integrations page.