HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
invariantlabs-ai
mcp-injection-experiments
Python2025–2025
invariantlabs-ai / mcp-injection-experiments

mcp-injection-experiments

Code snippets to reproduce MCP tool poisoning attacks.

3Distinct people
3Mentions
0Explicit recommenders
211GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Code snippets to reproduce MCP tool poisoning attacks.

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 9–Nov 16 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/16/2026, 3:59:04 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by day3 dated mentions

Observed mentions: 2025-04-06 14:32:42 UTC to 2025-04-14 16:17:06 UTC.

0122025-04-06 00:00:00 UTC to 2025-04-07 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsApr 62025-04-07 00:00:00 UTC to 2025-04-08 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-04-08 00:00:00 UTC to 2025-04-09 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-04-09 00:00:00 UTC to 2025-04-10 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-04-10 00:00:00 UTC to 2025-04-11 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsApr 102025-04-11 00:00:00 UTC to 2025-04-12 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-04-12 00:00:00 UTC to 2025-04-13 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-04-13 00:00:00 UTC to 2025-04-14 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-04-14 00:00:00 UTC to 2025-04-15 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 commentsApr 14

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Apr 62025-04-06 00:00:00 UTC2025-04-07 00:00:00 UTC101
Apr 72025-04-07 00:00:00 UTC2025-04-08 00:00:00 UTC000
Apr 82025-04-08 00:00:00 UTC2025-04-09 00:00:00 UTC000
Apr 92025-04-09 00:00:00 UTC2025-04-10 00:00:00 UTC000
Apr 102025-04-10 00:00:00 UTC2025-04-11 00:00:00 UTC000
Apr 112025-04-11 00:00:00 UTC2025-04-12 00:00:00 UTC000
Apr 122025-04-12 00:00:00 UTC2025-04-13 00:00:00 UTC000
Apr 132025-04-13 00:00:00 UTC2025-04-14 00:00:00 UTC000
Apr 142025-04-14 00:00:00 UTC2025-04-15 00:00:00 UTC202

What Hacker News says

2 sources
I've recently written a custom MCP server. > An MCP server is at it's heart some 'thing' that provides a set of 'tools' that an LLM can invoke. A "tool" is one of several capabilities that a MCP server can provide to its callers. Other capabilities include "prompt" and "resource". > This is done by adding a 'tool definition'. A 'tool definition' is content that goes into the LLM prompt. That's how it works. How do you imagine an LLM can decide to use a tool? It's only possible if the tool definition is in the prompt. I think you're using an expansive definition of "prompt" that includes not just the input text as provided by the user -- which is generally what most people understand "prompt" to mean -- but also all available user- and client-specific metadata. That's fine, just want to make it explicit. With this framing, I agree with you
Read the rest
, that every MCP server added to a client -- whether that's Claude.app, or some MyAgent, or whatever -- adds some amount of overhead to that client. But that overhead is gonna be fixed-cost, and paid one-time at e.g. session initialization, not every time per e.g. request/response. So I'm struggling to imagine a situation where those costs are anything other than statistical line noise, compared to the costs of actually processing user requests. > https://docs.anthropic.com/en/docs/build-with-claude/tool-us... To be clear, this concept of "tool" is completely unrelated to MCP. > https://github.com/invariantlabs-ai/mcp-injection-experiment... I don't really understand this repo or its criticisms. The authors wrote a related blog post https://invariantlabs.ai/blog/whatsapp-mcp-exploited which says (among other things) that > In this blog post, we will demonstrate how an untrusted MCP server ... But there is no such thing as "an untrusted MCP server". Every MCP server is assumed to be trusted, at least as the protocol is defined today.
In Everything wrong with MCP
> they only incur a cost to the client, and only impact the user context, if/when they're invoked. Look it up. Look up the cross server injection examples. I guarantee you this is not true. An MCP server is at it's heart some 'thing' that provides a set of 'tools' that an LLM can invoke. This is done by adding a 'tool definition'. A 'tool definition' is content that goes into the LLM prompt. That's how it works. How do you imagine an LLM can decide to use a tool? It's only possible if the tool definition is in the prompt. The API may hide this, but I guarantee you this is how it works. Putting an arbitrary amount of 3rd party content into your prompts has a direct tangible impact on LLM performance (and cost). The more MCP servers you enable the more you pollute your prompt with tool definitions, and, I assure you, the worse the results a
Read the rest
re as a result. Just like pouring any large amount of unrelated crap into your system prompt does. At a small scale, it's ok; but as you scale up, the LLM performance goes down. Here's some background reading for you: https://github.com/invariantlabs-ai/mcp-injection-experiment... https://docs.anthropic.com/en/docs/build-with-claude/tool-us...
In Everything wrong with MCP

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.