Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

lsquare

Latest version: v0.2.0b9

Overview

Last scanned
24 Nov 2026
Published
24 Nov 2026
PyPI package Publisher: lisaakselrod, ludo_gelso
0 Stars
0 Forks
10 Versions
1.1K Downloads
Python Repo language

Scan summary

lsquare was last scanned on 24 Nov 2026 at version 0.2.0b9. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 10 versions; the latest 2 were published within 5 days (20–24 Nov 2026).
  • Findings: No rules fired in version 0.2.0b9.
  • Downloads: 1,087 downloads.

Versions

10 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.2.0b9 LATEST 24 Nov 2026 No rules fired
0.2.0b8 20 Nov 2026 No rules fired
0.2.0b7 10 Nov 2026 1 rule fired
0.2.0b6 2 Nov 2026 Not shown
0.2.0b5 31 Oct 2026 Not shown

No rules fired in 0.2.0b9

Findings

Findings for v0.2.0b9. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.2.0b9; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

lsquare

Record every tool call your MCP server handles, and the agent turns behind them, in LSquare. Pre-release: LSquare is an invite-only beta, so request access to get an API key. During the beta, LSquare sends you a weekly report on your tool calls (the most used, failing and slowest tools, missing tools and top intents), and exports on request.

  • One line per MCP server. Nothing the SDK does can make a tool call fail, and it never raises.
  • capture() never waits on the network, and flush() waits up to 2 seconds by default, then up to half a second more for a slow on_error or logger.
  • Common private data is redacted, and long values shortened, before anything leaves your process.
  • No runtime dependencies. Python 3.10 and later; the same events as LSquare's TypeScript SDK.
  • Events are stored in the United States. If you serve customers in the EU, take that into account.

Quickstart

A server with one tool, served over HTTP on your machine, and one call to it with curl.

  1. Install the MCP Python SDK (2.x here; 1.x and fastmcp work too, below), then lsquare, which is a pre-release until launch: --pre on its own line, so it doesn't also pick up pre-releases of the SDK.

    pip install mcp
    pip install --pre lsquare
  2. Instrument the server, in server.py:

    import os
    
    from lsquare import LSquare
    from lsquare.mcp import instrument
    from mcp.server.mcpserver import MCPServer
    
    lsquare = LSquare(api_key=os.environ.get("LSQUARE_KEY"))
    
    mcp = MCPServer("weather")
    
    # Text results only: see structuredContent under session_id, in REFERENCE.md.
    @mcp.tool(structured_output=False)
    def get_forecast(city: str) -> str:
        """Gives tomorrow's forecast for a city."""
        return f"Tomorrow in {city}: sunny, 21°C."
    
    instrument(mcp, lsquare)
    
    if __name__ == "__main__":
        mcp.run(transport="streamable-http", stateless_http=True)

    On mcp 1.x: from mcp.server.fastmcp import FastMCP, mcp = FastMCP("weather", stateless_http=True) and mcp.run(transport="streamable-http").

  3. See the first event, in dry run, where nothing is sent:

    LSQUARE_DRY_RUN=1 python server.py

    In another terminal, call the tool:

    curl -s http://127.0.0.1:8000/mcp -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_forecast","arguments":{"city":"Paris"}}}'

    The reply is your tool's result, then a text block with the call's task ID, "Task ID: ses_…" (session_id, in the reference). The server's terminal shows a line for what instrument() did, and one for the call's event: its fields and size, never its content or IDs.

    [lsquare dry-run] {"server":"weather","level":"high","records":"every tools/call","extras":{…}}
    [lsquare dry-run] {"kind":"tool_call","eventId":"the call","fields":["callId","durationMs","input","result","server","sessionId","sessionSource","status","toolDescription","toolName"],"bytes":629}
  4. Send it. Stop the server, start it again with your project key instead of dry run, and call the tool again:

    LSQUARE_KEY=lsq_your_key python server.py

    Nothing is printed when LSquare accepts an event. A problem is logged as one [lsquare] line, such as [lsquare] send_failed: LSquare answered 401; not retried. for a key it doesn't know.

Without a key, and outside dry run, the client is disabled: capture() does nothing and instrument() leaves your servers exactly as they are, with one warning. Over stdio, the dry-run lines go to the server's standard error, which MCP clients keep in their logs. Before deploying, read Serverless hosts and shutting down: hosts that stop your process once it has replied, and sending what's still queued when it ends (on SIGTERM, a synchronous server just exits, sys.exit(0), and never calls the SDK from the handler). An agent that isn't behind an MCP server records its turns with capture(): agent turns outside MCP.

MCP servers

import os
from lsquare import LSquare
from lsquare.mcp import instrument
from mcp.server.fastmcp import FastMCP

lsquare = LSquare(api_key=os.environ.get("LSQUARE_KEY"))   # once, at module level

mcp = FastMCP("orders")

@mcp.tool()
def search_orders(customer_id: str) -> str: ...

instrument(mcp, lsquare)                                     # the one line per server

instrument() takes a server of the official MCP Python SDK, 1.x (FastMCP, or a low-level Server) or 2.x (MCPServer, or a low-level Server), or of fastmcp 3.x or 4.x (FastMCP). It returns the server it was given, and instrumenting a server twice does nothing the second time. Tools registered after it are covered too. Instrument a server before running it: a client that listed its tools before keeps a copy without the extras (below) until it lists them again. On mcp 2.x, instrument after adding your own middleware to the server: replacing its middleware list afterwards removes the wrapper.

Each call that reaches the server's tools/call dispatch becomes one tool_call event: the tool's name, its arguments (input), its result, how it ended (status, and an error with its category: thrown, tool_error, protocol or timeout), how long it took, the calling app and protocol version, and the IDs below. Results are recorded as the SDK sends them, each string cut at 4,000 characters; turn inputs or results off everywhere, or for chosen tools, with inputs and results. The event also carries the tool's description as agents were listed it (toolDescription, cut at 1,000 characters), so you can tell which wording a call was made under; descriptions turns that off the same way (where it comes from). A failed call's text, in error.message and in an isError result, can quote what the tool was sent and what it would have returned, so it's recorded only with both on. The event still says how the call failed: category, type and code. A cancelled call's fixed sentence stays. A call the client cancelled is a timeout, also when your tool caught the cancellation and returned. fastmcp's call_tool(), called from your own Python code, never reaches the dispatch and makes no event; called inside a call (from a tool or a task it started, from middleware, or from a fastmcp 4.x extension's interceptor), it leaves that call's record alone too.

What the defaults change in your server

On a high-level server three extras are on by default, so calls are grouped into tasks, each call says why it was made, and agents can tell you what they couldn't find. They change what your server shows its callers:

  • every tool gains two optional inputs, session_id and intent, which the wrapper takes out of each call before the SDK checks it, so your code never sees them;
  • some results gain one text block at the end, giving the agent a task ID;
  • the server gains a tool, get_more_tools, which the wrapper answers itself.

Clients and scanners that flag changed tool definitions may warn your server's users once when you add the SDK. Each extra can be turned off by itself, in your one instrument() call:

instrument(mcp, lsquare, extras={
    "sessions": False,        # no session_id, no task ID line
    "intent": False,          # no intent
    "missing_tools": False,   # no get_more_tools
})                            # leave any of them out to keep it on

extras=False turns all three off at once. With all three off, the wrapper never changes arguments, results or errors. On a low-level Server they're off (in the reference), whose extras section says exactly what each one does.

instrument() options
Option Default
identify (call) -> {"orgId", "userId", "conversationId", "metadata"} or None, sync or async (how it works)
inputs True False, or (tool_name) -> bool. Off for get_more_tools, the server doesn't get that tool
results True False, or (tool_name) -> bool
descriptions True False, or (tool_name) -> bool. On a low-level Server, a call has the description its instance last listed (details)
extras all on (high-level), off (low-level) {"sessions", "intent", "missing_tools"} to booleans; one left out keeps its default. False: all off. On a low-level server only True turns one on (in the reference)
wait_until A callable taking an awaitable: each call's sending is handed to it (serverless hosts)
flush_before_reply False Wait for each call's event to be sent, up to flush_timeout_ms, before replying

In dry run, instrument() logs one line per server saying what the extras can change.

The extras

How each extra works, which tools get them, and the extras on low-level servers are in the reference. Here is what agents did with them.

What agents do with them

Checked on 29 October 2026 with Claude Code 2.1.312 (Claude Opus 5.5) and Codex CLI 0.165.0 (gpt-6-astra, high reasoning effort), each doing the same multi-step tasks on a sample shop server with the default extras: on TypeScript (MCP SDK 2.x) and on Python (mcp 1.x), over stdio and over stateless HTTP. Each task ran once on each of those, 26 runs per agent, so these say what each agent did, not how often it would. Codex ran headless (codex exec, a new process for each turn of a conversation). Cursor, Claude desktop and ChatGPT aren't checked yet, and nothing here is about them.

  • intent: both agents filled it in on every call to the server's own tools (94 of 94 for Claude Code, 74 of 74 for Codex), and neither put the task's personal data in it, though one task's prompt gave a customer's name, email address and phone number.
  • session_id, over stateless HTTP: once the model had seen a task's ID line, every later call it made for that task sent the ID back (Claude Code 24 of 24, Codex 22 of 22). Separately, subagents' calls sent their parent's ID (7 of 7, 6 of 6). When the conversation moved on to an unrelated task, neither sent the earlier task's ID.
  • Parallel first calls: over HTTP, Claude Code often started a task with several calls at once, before any result had come back, so each got its own ID and the task was split across them (7 of 16 tasks, counting an unrelated follow-up as a task of its own). Codex made one call first and sent its ID on the rest, and no task was split over HTTP.
  • Protocol versions: Codex used 2025-06-18 everywhere; Claude Code used 2026-07-28 over HTTP on the TypeScript server and 2025-11-25 otherwise (over stdio, and against mcp 1.x, which has no 2026-07-28). So over stdio neither got an ID line: their calls were grouped by the stdio connection, which puts everything sent over it together, whatever the task. Claude Code's subagents used their parent's connection; each of Codex's opened its own, so over stdio its task with subagents was split by connection. On a stateful HTTP server, a client on a version before 2026-07-28 is grouped the same way, by its Mcp-Session-Id, without an ID line; these runs didn't try one.
  • structuredContent: for a tool with an output schema, Claude Code showed the model only the structured result, so the ID line never reached it (0 of 2 sent back). Codex showed the text blocks as well and sent the ID back (2 of 2).
  • get_more_tools: both called it in every run where no tool fitted, or one fitted only in part (8 of 8 each). Claude Code never called it otherwise. Codex did in 3 of the 18 runs where the tools fitted: each time, after confirming a customer had been charged twice and before answering, it asked for the payment-processor logs that would explain why. Run again on 9 November 2026 (Claude Code 2.1.321, Codex CLI 0.167.0) with the tool marked readOnlyHint: false and the server's tools allowed in advance, Claude Code called it in every run where no tool fitted (16 of 16) and never otherwise. Codex blocked all 16 of its attempted calls: it asks the person before a tool that isn't marked read-only, and these runs had approvals off. Marked read-only, as it is now, Codex called it in every run where no tool fitted (16 of 16, over stdio on both servers) and in 2 of the 4 where one did. Claude Code wasn't run again: in its default permission mode it asks before any MCP tool its settings don't allow, read-only or not.

What leaves your process

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases lsquare

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Copy of Template Design OX Blog (1)
Research

Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret Stealing Malware Via GitHub Actions & npm

PolinRider Returns
Research

PolinRider Returns: Hijacked npm Packages Use Ethereum Blockchain to Conceal Malware Infrastructure

Frame 2085668439 (1)
Group 1261154229