sun-tzu-mcp
An MCP server that finds Sun Tzu quotes for workplace situations, matching plain-language descriptions to verses from The Art of War with chapter citations, plus tools for themes, random quotes, and PNG quote cards.
README
sun-tzu-mcp
An MCP server that finds the Sun Tzu quote for a situation. Built for workplace use: describe what is happening ("the PM keeps adding scope two days before release") and get back verses from The Art of War with their chapter citation, so the quote you paste is the quote Sun Tzu actually wrote.
Tools
| Tool | What it does |
|---|---|
find_quote(situation, count?, theme?) |
Matches a plain-language situation to verses, best first |
list_themes() |
The theme vocabulary, with a gloss and verse count for each |
random_quote(theme?) |
One verse at random from the annotated set |
quote_card(situation? | verse?, caption?, scale?) |
Renders a verse as a PNG card, 1200x630, and copies it to the clipboard |
There is also a sun-tzu://corpus resource holding all 383 verses.
The card is written to a temp file and put on the clipboard. Clipboard copying is macOS only; on other platforms the PNG is still written and the tool says so instead of failing.
caption sets one italic line above the verse, for framing the quote (On being told "good job"). It is
taken verbatim, shrunk to fit, then clipped with an ellipsis. Omit it for a bare card.
Install
Needs Node 20 or newer. Nothing else: no API key, no network, no database.
claude mcp add sun-tzu -- npx -y sun-tzu-mcp
Or, for any MCP client that takes a JSON config:
{
"mcpServers": {
"sun-tzu": {
"command": "npx",
"args": ["-y", "sun-tzu-mcp"]
}
}
}
The server runs locally as a subprocess of the client and talks stdio. Nothing is hosted, nothing phones home.
From a clone
pnpm install
pnpm build
claude mcp add sun-tzu -- node /absolute/path/to/sun-tzu-mcp/dist/index.js
How matching works
No embeddings, no network, no API key. The corpus ships with the server and matching is deterministic:
- The situation is normalized, tokenized and stemmed.
- A lexicon maps working-life vocabulary onto the theme vocabulary, so
reorgreaches verses taggedadaptabilityandmicromanagereachesdelegationwithout sharing a word with the text. - Verses score on three fields: matched themes (weight 3), curated situation hints (2), and verse text (1). A theme that several query terms agree on counts for more, which keeps an incidental word from steering the result.
The tradeoff: paraphrase far outside the lexicon matches less well than embeddings would. In exchange it is instant, free, offline and debuggable, and the calling model is already good at rewriting a situation into words the lexicon knows.
Data
data/source/pg132.txt— the Giles 1910 translation, Project Gutenberg #132, public domain.data/verses.json— generated. 383 verses parsed out of the source bypnpm corpus. Do not edit by hand.data/tags.json— hand-curated. Themes and situation hints for the verses that carry over to working life. Kept separate fromverses.jsonso re-parsing never wipes it.data/themes.json— the theme vocabulary.tags.jsonis validated against it at server startup, so an unknown theme fails loudly instead of silently never matching.
Parsing notes
The Gutenberg plain text interleaves Giles' commentary with the verses and its brackets are not
reliable: blocks are missing opening brackets, missing closing brackets, and one verse (V.9) is missing
the period after its number. Character-level bracket counting silently swallows whole chapters. The
parser therefore works paragraph by paragraph, uses verse numbers as hard boundaries, and falls back on
markers of Giles' voice (commentator names, dates, "says:") where the brackets fail. pnpm corpus
prints verse coverage per chapter and flags any gap in the numbering, so a regression is visible.
Tests
pnpm build && pnpm test
Covers the corpus (verse count, citation format, no commentary leakage) and the matcher (a table of
situations that must each reach a specific verse in the top 3). Add a row to EXPECTED in
test/match.test.mjs when you extend the lexicon.
Licence
The translation is public domain. The code and the curation are MIT.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.