facturas-mcp
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., "@facturas-mcp ¿Cuánto vendí en lo que va del mes según DWH.facturas?"
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.
facturas-mcp
Read-only MCP server for asking Claude Desktop about DWH.facturas.
How it works
Claude Desktop launches this server locally (its own process, communicating over stdio).
The server connects to SQL Server using a read-only login (
mcp_readonly) that only hasGRANT SELECTonDWH.facturas. That permission lives in the database, not in this code -- it is the real security barrier.It exposes two tools:
listar_columnas_facturas: so Claude can discover the columns before writing SQL.consultar_facturas: runs a read-onlySELECTagainstDWH.facturas.
Related MCP server: Microsoft SQL Server MCP Server
Step 1 -- Create the restricted login in SQL Server
Run setup-db-login.sql ONCE, with a user who has administrative permissions on the database. Change the example password before running it.
Step 2 -- Configure this server's credentials
Create a .env file in this folder (it is not committed to git) with:
MSSQL_SERVER=sintesiserp.com
MSSQL_DATABASE=Diverxamotos_4_2
MSSQL_USER=mcp_readonly
MSSQL_PASSWORD=la-contrasena-que-pusiste-en-el-paso-1Step 3 -- Register the server in Claude Desktop
Open claude_desktop_config.json (on Windows: %APPDATA%\Claude\claude_desktop_config.json) and add this inside "mcpServers":
{
"mcpServers": {
"facturas": {
"command": "node",
"args": ["C:\\Users\\Developer-07\\Documents\\DESARROLLO\\facturas-mcp\\dist\\index.js"],
"env": {
"MSSQL_SERVER": "sintesiserp.com",
"MSSQL_DATABASE": "Diverxamotos_4_2",
"MSSQL_USER": "mcp_readonly",
"MSSQL_PASSWORD": "la-contrasena-que-pusiste-en-el-paso-1"
}
}
}
}Close Claude Desktop completely and reopen it so it loads the new server.
Step 4 -- Test it
In Claude Desktop, ask something like: "How much did I sell today according to DWH.facturas?"
Adding another table later
In SQL Server:
GRANT SELECT ON DWH.otratabla TO mcp_readonly;In
src/index.ts: add"DWH.OTRATABLA"to theALLOWED_TABLESarray, and optionally alistar_columnas_otratablatool just like the existing one.npm run buildand restart Claude Desktop.
Remote mode (Render) -- so multiple people can use it from Claude.ai
By default the server runs in stdio mode (local, one process per user, launched by Claude Desktop). To let multiple people use it from Claude.ai without installing anything, it can be deployed as an HTTP service on Render. The same dist/index.js works for both modes -- the switch is the MCP_TRANSPORT environment variable.
Important: in HTTP mode the only protection for the database is still the read-only login, but the MCP server itself is exposed at a public URL. That is why HTTP mode requires a token (MCP_AUTH_TOKEN) -- without it, the process won't even start. Anyone with the URL and the token can run SELECT against DWH.facturas, so treat that token like a password: don't publish it, don't commit it to git, and rotate it if it leaks.
Step 1 -- Generate a strong token
For example, with PowerShell:
-join ((48..57)+(65..90)+(97..122)|Get-Random -Count 40|%{[char]$_})Save that value -- it is your MCP_AUTH_TOKEN.
Step 2 -- Create the Web Service in Render
Push this project to a GitHub repository (you need
node_modulesanddistout of the repo -- they are already in.gitignore-- Render runsnpm installandnpm run buildon its own).In Render: New -> Web Service, connect the repo.
Build Command:
npm install && npm run buildStart Command:
npm startEnvironment variables (Environment tab):
MCP_TRANSPORT=http MCP_AUTH_TOKEN=<el token del paso 1> MSSQL_SERVER=sintesiserp.com MSSQL_DATABASE=Diverxamotos_4_2 MSSQL_USER=mcp_readonly MSSQL_PASSWORD=<la contrasena del login de solo lectura>(Render sets
PORTautomatically -- no need to add it.)Deploy. When it finishes, Render gives you a URL like
https://facturas-mcp.onrender.com.
Step 3 -- Test that the server responds
curl https://facturas-mcp.onrender.com/health
# {"status":"ok"}
curl -X POST https://facturas-mcp.onrender.com/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "Authorization: Bearer <tu MCP_AUTH_TOKEN>" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'If it responds with serverInfo and capabilities, the server is alive and accepting the token. Without the correct Authorization header it should respond with 401.
Step 4 -- Connect it from Claude.ai / Claude Desktop
In Claude.ai (or recent Claude Desktop): Settings -> Connectors -> Add custom connector, and register the URL https://facturas-mcp.onrender.com/mcp with the authentication header Authorization: Bearer <tu MCP_AUTH_TOKEN> (the exact UI may vary depending on the version of Claude -- look for the remote MCP server / custom connector option).
Note: Render's free plan "sleeps" the service after inactivity -- the first request after the sleep can take a few seconds to respond.
Available Tools
2 toolsconsultar_facturasA
Ejecuta una consulta SQL de solo lectura (SELECT) contra la tabla DWH.facturas para responder preguntas de negocio (ventas del dia, totales por cliente, facturas de un periodo, etc). Solo se permite SELECT sobre DWH.facturas -- cualquier otra cosa se rechaza. Si no conoces las columnas de la tabla, usa primero la herramienta listar_columnas_facturas.
Inputs: sql (required).
listar_columnas_facturasA
Devuelve el nombre y tipo de cada columna de la tabla DWH.facturas. Usa esta herramienta primero, antes de escribir una consulta, si no conoces el esquema de la tabla.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct roles: one is for inspecting the table schema, the other for executing read-only SQL queries against the table. There is no overlap or ambiguity about which to call.
Both tool names follow the same lowercase snake_case verb_object pattern in Spanish: listar_columnas_facturas and consultar_facturas. The naming is predictable and aligns with each tool's function.
With only two tools, the server is minimal, but the scope is intentionally narrow: schema discovery plus SQL querying of a single invoices table. This is slightly below the typical 3-15 tool range but reasonable and well-scoped for its purpose.
For a read-only query server over DWH.facturas, the surface is complete: agents can discover the schema and then run arbitrary SELECT queries to answer business questions. No obvious additional operations are needed for the stated purpose.
Maintenance
Related MCP Connectors
Read and write Sage Intacct from Claude or ChatGPT. Write tools are flagged for approval.
Spanish Veri*factu invoicing: create invoices, expenses and VAT returns from your AI assistant.
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
Connect Claude to Dutch accounting software: e-Boekhouden invoices, contacts and ledgers.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to connect and query Microsoft SQL Server databases using natural language, executing read-only SQL queries for safe data inspection and analysis.MIT
- AlicenseNot gradedqualityDmaintenanceProvides secure SQL Server database access, allowing users to list tables and execute SQL queries through natural language in Claude Desktop.MIT
- FlicenseNot gradedqualityDmaintenanceEnables secure interaction with Microsoft SQL Server databases, allowing schema exploration, metadata retrieval, and read-only query execution through natural language.1-
- FlicenseNot gradedqualityDmaintenanceEnables querying Microsoft SQL Server databases using natural language or predefined SQL, with read-only safety. Integrates with Cursor and Claude Desktop for database exploration and management.-