andreisirbu91-lab/MCPSpend
Real-time cost observability for Model Context Protocol (MCP) tool calls. Wraps any MCP server, attributes spend per tool/project/customer. Free tier 25K calls/mo. EU-hosted
4c18b8258514mcpspend0.1.0 in package.jsonio.github.andreisirbu91-lab/mcpspendPaths from tool input into commands, SQL, files and URLs
How much power the tools give an agent over the machine
Hidden instructions and poisoning in text for the model
Known vulnerabilities in the packages the server uses
How the server reads credentials and where they can go
Whether the tools do only what their descriptions say
How far the analysis went
The scanner traces each tool from its input to the operations its code performs, and here it could not follow every path. Code Safety is shown as partly traced instead of a score: no finding there is not a clean result. The score of Capability Exposure counts only what it could follow.
- In 6 places a tool's input is handed to a function whose name matches several definitions in the code; the scanner could not tell which one runs, so it stopped there
- 68 source files could be read only in part
- Supply Chain: the dependency files state no exact versions the scanner could check, so it has no number
Top risks in plain words
- INFONo published risk: no tool declared to run commands, files, addresses or queries of the caller's choice, no known vulnerability in a production package, no advisory. Not every path through the code could be followed. Code findings appear here only after a person has verified them.
How to use it safely
Practical steps from what we found in this server. They lower the risk; they do not replace a review of the code.
- Give it a narrowly scoped token
Its code reads credentials or environment variables. Use a key limited to what this server needs, not your main one.
- Keep confirmations on
Leave your MCP client's confirmation prompt on for tools that change files, run commands or send data.
What its tools can do on your machine
The server offers 4 tools. When an AI agent calls them, this is what their code can do on the machine where the server runs, as traced in the source. Tools that call code the scanner could not follow may do more.
get_today_cost, get_usage_this_month, list_recent_sessions, list_top_toolsget_today_cost, get_usage_this_month, list_recent_sessions, list_top_toolsget_today_cost, get_usage_this_month, list_recent_sessions, list_top_toolsNo tool was seen to: start other programs on the machine; read or write files; connect to the internet or other hosts.
Where its requests and secrets go
Read from the names along each tool's calls, not from a run: what the code says, not every address it may reach at run time.
The literal addresses the tools' requests name.
- None: no request names a fixed host.
Constants or settings that start an address; the value comes from configuration.
- None seen.
Credential-like environment variables. Give the server a key with the least access it needs.
- None: no credential-like variable is read by the tools.
Text it brings in from outside
No tool was seen returning text from outside the server to the model.
Tool annotations
No tool declares MCP annotations (readOnlyHint, destructiveHint and the rest). Clients use them to decide what to confirm; directories such as Anthropic's and OpenAI's ask for them.
Tools, prompts and resources (4: 4 tools)
Open a row for its full description. Chips show what its code can reach, and which risky capability its own description declares.
get_today_costtool Get total tool-call cost and call count for the current day (UTC). Returns a human-readable summary plus structured data.CredentialsEnv varsSensitive paths
Get total tool-call cost and call count for the current day (UTC). Returns a human-readable summary plus structured data.
get_usage_this_monthtool Returns calls used this month, plan limit, percentage used, and a projection for the rest of the month based on the current daily average. Use this to spot whenCredentialsEnv varsSensitive paths
Returns calls used this month, plan limit, percentage used, and a projection for the rest of the month based on the current daily average. Use this to spot when an org is about to hit the cap.
list_recent_sessionstool Recent agent sessions (each MCP-client process start = one session) with model, total cost, tool call count, and duration.CredentialsEnv varsSensitive paths
Recent agent sessions (each MCP-client process start = one session) with model, total cost, tool call count, and duration.
list_top_toolstool Top tools by total cost over the past N days. Optionally limit how many entries to return. Useful for finding "what is the most expensive thing my agents do".CredentialsEnv varsSensitive paths
Top tools by total cost over the past N days. Optionally limit how many entries to return. Useful for finding "what is the most expensive thing my agents do".
Text the model reads (4)
Every tool, prompt and resource description as written in the code: the model sees all of it, the user usually does not.
get_today_cost tool
Get total tool-call cost and call count for the current day (UTC). Returns a human-readable summary plus structured data.
get_usage_this_month tool
Returns calls used this month, plan limit, percentage used, and a projection for the rest of the month based on the current daily average. Use this to spot when an org is about to hit the cap.
list_top_tools tool
Top tools by total cost over the past N days. Optionally limit how many entries to return. Useful for finding "what is the most expensive thing my agents do".
list_recent_sessions tool
Recent agent sessions (each MCP-client process start = one session) with model, total cost, tool call count, and duration.
What we checked
The same checks run on every server. Each line below has one of these marks:
- 8 checks: command injection, argument injection, path traversal, server-side request forgery, SQL injection, code execution, unsafe deserialization, template injectionChecked on every scan. Results in this category are published only after a person has verified them.
- Runs programs the caller choosesNo tool runs a command or program the caller supplies — 4 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Executes caller-supplied codeNo tool evaluates code the caller supplies — 4 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Reads or writes any file pathNo tool works on a file path the caller supplies without a root check — 4 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Requests any addressNo tool sends a request to an address the caller supplies — 4 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Runs caller-supplied SQLNo tool executes a query the caller supplies — 4 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Tools that start processesNot seen in the traced code of 4 capabilities; 4 more call code the scanner could not follow, where it may happen
- Tools that touch filesNot seen in the traced code of 4 capabilities; 4 more call code the scanner could not follow, where it may happen
- Tools that call the networkNot seen in the traced code of 4 capabilities; 4 more call code the scanner could not follow, where it may happen
Where the code is: 4 handlers in 1 file at commit 4c18b8258514
- 5 checks: tool poisoning, instruction override, hidden content, exfiltration requests, metadata integrityChecked on every scan. Results in this category are published only after a person has verified them.
- Dependency manifests7 manifests: apps/api/package.json, apps/dashboard/package.json, package.json, packages/mcp-server/package.json, packages/proxy/package.json
- Lockfiles checked against OSVNothing could be resolved to exact versions; 8 not resolved: apps/api/package.json: dependency ranges declared here were not resolved against a lockfile and were not checked; apps/dashboard/package.json: dependency ranges declared here were not resolved against a lockfile and were not checked
- MCP SDK version@modelcontextprotocol/sdk ^1.0.4
- 3 checks: credential harvesting, undeclared credential access, credentials sent over the networkChecked on every scan. Results in this category are published only after a person has verified them.
- Tools that read credentials4 of 4 capabilities read credentials
- Environment variables4 capabilities read environment variables (often API keys)
- Authentication declaredNot checked: needs the live server's tools/list (a remote server declares how clients authenticate)
- 3 checks: undeclared network access, undeclared file access, undeclared process executionChecked on every scan. Results in this category are published only after a person has verified them.
- Tool descriptions presentEvery tool has a description the model and the user can read
- Statically known namesEvery tool's name could be read from the code
- Input schemasNot checked: needs the live server's tools/list (every tool declares an input schema)
- Destructive tools annotatedNot checked: needs the live server's tools/list (tools that write, delete or run commands carry destructivehint)
Dependencies with known vulnerabilities (0 in production)
Dependency ranges were not resolved against a lockfile, so the score is capped at 7.
No known vulnerabilities in the production dependencies that could be checked.
Past security advisories
Vulnerabilities published for this server itself, from the GitHub Advisory Database.
No security advisories have been published for this server in the GitHub Advisory Database.
How it runs
| Where it runs | On your machine, started by your MCP client from this repository or its package |
|---|---|
| Transport | stdio |
| Sign-in | not checked needs the live server |
| MCP SDK | @modelcontextprotocol/sdk ^1.0.4 |
| Servers in the code | 1 (mcpspend) |
The project's own security
| Security policy | yes SECURITY.md |
|---|---|
| Private reporting | the policy does not name a private channel |
| Past advisories | none in the GitHub Advisory Database |
| Last push | 2026-08-31 |
| Signed releases | not checked yet |
Where it is published
| Other npm packages | 1 package by other publishers point to this repositoryNot published by the repository's owner; check who publishes a package before you install it. |
|---|---|
| MCP Registry | io.github.andreisirbu91-lab/mcpspend |
| Listed in | 4 catalogs (github_search, glama, mcp_registry, mcp_toplist) |
| License | MIT |
| Created | 2026-05-22 |
| Topics | ai-agents ai-observability claude-desktop cost-tracking cursor llm-cost mcp model-context-protocol typescript windsurf |
Attack map
How the server is built and where its risky tools lead: servers, their tools, what the tools' code can do, and the traced route from a declared risky tool's argument to the operation it reaches. Click a node for details.