classical-strategy-mcp 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,16 @@
1
+ Metadata-Version: 2.4
2
+ Name: classical-strategy-mcp
3
+ Version: 0.1.0
4
+ Summary: MCP server: 5,000 years of military strategy — Napoleon, Sun Tzu, Clausewitz, Alexander, Hannibal, Genghis Khan, Shaka Zulu, Caesar
5
+ Project-URL: Homepage, https://github.com/gabrielmahia/classical-strategy-mcp
6
+ License: MIT
7
+ Keywords: clausewitz,history,mcp,military,napoleon,strategy,sun-tzu
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Requires-Python: >=3.10
12
+ Requires-Dist: fastmcp>=2.0.0
13
+ Description-Content-Type: text/markdown
14
+
15
+ # classical-strategy-mcp
16
+ 5,000 years of military strategy as AI tools.
@@ -0,0 +1,2 @@
1
+ # classical-strategy-mcp
2
+ 5,000 years of military strategy as AI tools.
@@ -0,0 +1,27 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "classical-strategy-mcp"
7
+ version = "0.1.0"
8
+ description = "MCP server: 5,000 years of military strategy — Napoleon, Sun Tzu, Clausewitz, Alexander, Hannibal, Genghis Khan, Shaka Zulu, Caesar"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = {text = "MIT"}
12
+ keywords = ["mcp","strategy","military","napoleon","sun-tzu","clausewitz","history"]
13
+ classifiers = [
14
+ "Development Status :: 4 - Beta",
15
+ "License :: OSI Approved :: MIT License",
16
+ "Programming Language :: Python :: 3",
17
+ ]
18
+ dependencies = ["fastmcp>=2.0.0"]
19
+
20
+ [project.urls]
21
+ Homepage = "https://github.com/gabrielmahia/classical-strategy-mcp"
22
+
23
+ [project.scripts]
24
+ classical-strategy-mcp = "classical_strategy_mcp.main:main"
25
+
26
+ [tool.hatch.build.targets.wheel]
27
+ packages = ["src/classical_strategy_mcp"]
@@ -0,0 +1 @@
1
+ __version__ = "0.1.0"
@@ -0,0 +1,104 @@
1
+ """classical-strategy-mcp — 5,000 years of military strategy."""
2
+ from __future__ import annotations
3
+ import json, pathlib
4
+ from typing import Annotated
5
+ from fastmcp import FastMCP
6
+
7
+ mcp = FastMCP(
8
+ name="classical-strategy-mcp",
9
+ instructions=(
10
+ "Access 5,000 years of military strategy and philosophy as AI tools. "
11
+ "Napoleon maxims, Sun Tzu, Clausewitz, Alexander, Hannibal, Genghis Khan, "
12
+ "Shaka Zulu, Caesar — all public domain, structured for AI analysis."
13
+ ),
14
+ )
15
+
16
+ COMMANDERS = {
17
+ "napoleon": {"dates":"1769-1821","nationality":"French","key_doctrine":"Corps system + central position + decisive battle","source":"Maximes de Guerre, 1831 (PD)"},
18
+ "sun_tzu": {"dates":"~500 BC","nationality":"Chinese","key_doctrine":"Win without fighting — supreme excellence","source":"Art of War (PD)"},
19
+ "clausewitz":{"dates":"1780-1831","nationality":"Prussian","key_doctrine":"Fog, friction, center of gravity, culminating point","source":"On War, 1832 (PD)"},
20
+ "alexander":{"dates":"356-323 BC","nationality":"Macedonian","key_doctrine":"Hammer (cavalry) + anvil (phalanx) + oblique approach","source":"Arrian (PD)"},
21
+ "hannibal": {"dates":"247-183 BC","nationality":"Carthaginian","key_doctrine":"Cannae double envelopment — feign weakness, encircle","source":"Polybius (PD)"},
22
+ "genghis": {"dates":"1162-1227","nationality":"Mongol","key_doctrine":"Intelligence + speed + feigned retreat + total warfare","source":"Secret History of the Mongols (PD)"},
23
+ "shaka": {"dates":"1787-1828","nationality":"Zulu","key_doctrine":"Iklwa close combat + bull-horn encirclement + amabutho system","source":"Isaacs, Fynn (PD)"},
24
+ "caesar": {"dates":"100-44 BC","nationality":"Roman","key_doctrine":"Speed + engineering + fortification + clemency","source":"De Bello Gallico (PD)"},
25
+ "machiavelli":{"dates":"1469-1527","nationality":"Florentine","key_doctrine":"Power realism — means justify ends in statecraft","source":"The Prince, 1532; Art of War, 1521 (PD)"},
26
+ "frederick":{"dates":"1712-1786","nationality":"Prussian","key_doctrine":"Oblique order + interior lines","source":"Instructions for His Generals, 1747 (PD)"},
27
+ }
28
+
29
+ MAXIMS = [
30
+ {"number":1,"text":"An army marches on its stomach.","category":"logistics","commander":"Napoleon"},
31
+ {"number":2,"text":"Never interrupt your enemy when he is making a mistake.","category":"strategy","commander":"Napoleon"},
32
+ {"number":3,"text":"The strength of an army is estimated by multiplying mass by rapidity.","category":"tactics","commander":"Napoleon"},
33
+ {"number":4,"text":"In war, three-quarters turns on personal character. Materials count for only a quarter.","category":"leadership","commander":"Napoleon"},
34
+ {"number":5,"text":"Supreme excellence consists in breaking the enemy's resistance without fighting.","category":"strategy","commander":"Sun Tzu"},
35
+ {"number":6,"text":"All warfare is based on deception.","category":"strategy","commander":"Sun Tzu"},
36
+ {"number":7,"text":"If you know the enemy and know yourself, you need not fear the result of a hundred battles.","category":"intelligence","commander":"Sun Tzu"},
37
+ {"number":8,"text":"War is the continuation of policy by other means.","category":"strategy","commander":"Clausewitz"},
38
+ {"number":9,"text":"In war, everything is simple, but the simplest thing is difficult.","category":"strategy","commander":"Clausewitz"},
39
+ {"number":10,"text":"Speed is the essence of war. Take advantage of the enemy's unpreparedness.","category":"tactics","commander":"Sun Tzu"},
40
+ {"number":11,"text":"It is better to be feared than loved, if you cannot be both.","category":"leadership","commander":"Machiavelli"},
41
+ {"number":12,"text":"Never fight against concentrated enemy forces when you are dispersed.","category":"tactics","commander":"Napoleon"},
42
+ {"number":13,"text":"Let your plans be dark and impenetrable as night, and when you move, fall like a thunderbolt.","category":"tactics","commander":"Sun Tzu"},
43
+ {"number":14,"text":"Wars are begun when one wills, but not ended when one wills.","category":"strategy","commander":"Machiavelli"},
44
+ {"number":15,"text":"The greatest general is he who makes the fewest mistakes.","category":"leadership","commander":"Napoleon"},
45
+ ]
46
+
47
+ @mcp.tool(description="Get military maxims from history's greatest commanders. Filter by category or commander.")
48
+ def get_maxims(category: Annotated[str,"Filter: strategy|tactics|logistics|leadership|intelligence|all"]="all",
49
+ commander: Annotated[str,"Filter by commander name or 'all'"]="all") -> dict:
50
+ results = MAXIMS
51
+ if category != "all": results = [m for m in results if m.get("category")==category]
52
+ if commander != "all": results = [m for m in results if commander.lower() in m.get("commander","").lower()]
53
+ return {"count":len(results),"maxims":results,"note":"All sources public domain"}
54
+
55
+ @mcp.tool(description="Get detailed doctrine analysis for a specific commander.")
56
+ def commander_doctrine(commander: Annotated[str,"Commander: napoleon|sun_tzu|clausewitz|alexander|hannibal|genghis|shaka|caesar|machiavelli|frederick"]="napoleon") -> dict:
57
+ d = COMMANDERS.get(commander.lower())
58
+ if not d: return {"error":f"Not found. Available: {list(COMMANDERS.keys())}"}
59
+ return {"commander":commander.title(), **d}
60
+
61
+ @mcp.tool(description="Apply classical strategy principles to a modern problem.")
62
+ def apply_classical_strategy(problem: Annotated[str,"Describe your strategic challenge"],
63
+ lens: Annotated[str,"Focus: competition|leadership|intelligence|resources|operations"]="competition") -> dict:
64
+ frameworks = {
65
+ "competition": ["Sun Tzu: Win without fighting — superior position before battle","Napoleon: Concentrate force at the decisive point","Hannibal: Appear weak where you plan to be strong (Cannae)","Clausewitz: Identify the enemy's center of gravity","Caesar: Speed as strategic weapon — arrive before expected"],
66
+ "leadership": ["Napoleon: Three-quarters of war is character, only a quarter is material","Alexander: Lead from the front — personal risk creates disproportionate loyalty","Shaka: Reward performance, not seniority — amabutho system","Clausewitz: Friction is constant — plan for it, don't be surprised","Frederick: Train harder than you fight"],
67
+ "intelligence":["Sun Tzu: Foreknowledge from men, not spirits — human intelligence first","Genghis Khan: Know enemy terrain, politics, morale before engaging","Napoleon: Never rely on a single source — cross-verify everything","Caesar: Personally observe — don't rely solely on reports"],
68
+ "resources": ["Napoleon: Concentrate before committing — dispersion before decision is fatal","Clausewitz: Know your culminating point — stop before you overextend","Genghis Khan: Self-sustaining force — minimize supply line dependence","Frederick: Concentration at decisive point beats numerical superiority"],
69
+ "operations": ["Caesar: Speed + fortification — move fast, consolidate immediately","Napoleon: Corps system — autonomous units, centralized intent","Genghis Khan: 60-80 miles/day — speed multiplies all other advantages","Shaka: Total system transformation, not incremental improvement"],
70
+ }
71
+ return {"problem":problem,"lens":lens,"frameworks":frameworks.get(lens,frameworks["competition"]),"source":"Synthesized from public domain military literature"}
72
+
73
+ @mcp.tool(description="Get a bibliography of major public domain strategic works with descriptions.")
74
+ def strategic_library(domain: Annotated[str,"Domain: military|philosophy|history|all"]="all") -> dict:
75
+ lib = {
76
+ "military":[
77
+ {"title":"The Art of War","author":"Sun Tzu","date":"~500 BC","format":"Book, AI dataset, structured JSON"},
78
+ {"title":"On War (Vom Kriege)","author":"Clausewitz","date":"1832","format":"Book, workbook editions"},
79
+ {"title":"The Gallic Wars","author":"Julius Caesar","date":"58 BC","format":"Primary source narrative"},
80
+ {"title":"Napoleon's Maxims","author":"Napoleon Bonaparte","date":"1831","format":"Aphorism collection, card deck potential"},
81
+ {"title":"Instructions for His Generals","author":"Frederick the Great","date":"1747","format":"Leadership manual"},
82
+ {"title":"Epitome Rei Militaris","author":"Vegetius","date":"~390 AD","format":"Military manual"},
83
+ ],
84
+ "philosophy":[
85
+ {"title":"Meditations","author":"Marcus Aurelius","date":"~180 AD","format":"Journal, daily reading"},
86
+ {"title":"The Prince","author":"Machiavelli","date":"1532","format":"Political treatise"},
87
+ {"title":"Letters from a Stoic","author":"Seneca","date":"~65 AD","format":"Letters, wisdom collection"},
88
+ {"title":"Enchiridion","author":"Epictetus","date":"~135 AD","format":"Stoic handbook"},
89
+ ],
90
+ "history":[
91
+ {"title":"Histories","author":"Polybius","date":"~150 BC","format":"Primary source — Hannibal"},
92
+ {"title":"Parallel Lives","author":"Plutarch","date":"~100 AD","format":"Biographical — Alexander, Caesar"},
93
+ {"title":"Travels in Eastern Africa","author":"Nathaniel Isaacs","date":"1836","format":"Primary source — Shaka Zulu"},
94
+ {"title":"Secret History of the Mongols","author":"Anonymous","date":"~1240","format":"Primary source — Genghis Khan"},
95
+ ],
96
+ }
97
+ if domain == "all": return {"library":lib,"total":sum(len(v) for v in lib.values())}
98
+ return {"domain":domain,"works":lib.get(domain,[])}
99
+
100
+ def main():
101
+ mcp.run()
102
+
103
+ if __name__ == "__main__":
104
+ main()