@lagoon-protocol/lagoon-mcp 0.1.0

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.
Files changed (335) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +618 -0
  3. package/dist/cache/index.d.ts +97 -0
  4. package/dist/cache/index.d.ts.map +1 -0
  5. package/dist/cache/index.js +106 -0
  6. package/dist/cache/index.js.map +1 -0
  7. package/dist/config.d.ts +34 -0
  8. package/dist/config.d.ts.map +1 -0
  9. package/dist/config.js +40 -0
  10. package/dist/config.js.map +1 -0
  11. package/dist/core/cache-adapter.d.ts +73 -0
  12. package/dist/core/cache-adapter.d.ts.map +1 -0
  13. package/dist/core/cache-adapter.js +47 -0
  14. package/dist/core/cache-adapter.js.map +1 -0
  15. package/dist/core/cache-invalidation.d.ts +72 -0
  16. package/dist/core/cache-invalidation.d.ts.map +1 -0
  17. package/dist/core/cache-invalidation.js +114 -0
  18. package/dist/core/cache-invalidation.js.map +1 -0
  19. package/dist/core/container.d.ts +34 -0
  20. package/dist/core/container.d.ts.map +1 -0
  21. package/dist/core/container.js +75 -0
  22. package/dist/core/container.js.map +1 -0
  23. package/dist/graphql/client.d.ts +32 -0
  24. package/dist/graphql/client.d.ts.map +1 -0
  25. package/dist/graphql/client.js +49 -0
  26. package/dist/graphql/client.js.map +1 -0
  27. package/dist/graphql/fragments/apr-breakdown.fragment.d.ts +64 -0
  28. package/dist/graphql/fragments/apr-breakdown.fragment.d.ts.map +1 -0
  29. package/dist/graphql/fragments/apr-breakdown.fragment.js +62 -0
  30. package/dist/graphql/fragments/apr-breakdown.fragment.js.map +1 -0
  31. package/dist/graphql/fragments/asset-info.fragment.d.ts +18 -0
  32. package/dist/graphql/fragments/asset-info.fragment.d.ts.map +1 -0
  33. package/dist/graphql/fragments/asset-info.fragment.js +36 -0
  34. package/dist/graphql/fragments/asset-info.fragment.js.map +1 -0
  35. package/dist/graphql/fragments/chain-info.fragment.d.ts +18 -0
  36. package/dist/graphql/fragments/chain-info.fragment.d.ts.map +1 -0
  37. package/dist/graphql/fragments/chain-info.fragment.js +32 -0
  38. package/dist/graphql/fragments/chain-info.fragment.js.map +1 -0
  39. package/dist/graphql/fragments/index.d.ts +15 -0
  40. package/dist/graphql/fragments/index.d.ts.map +1 -0
  41. package/dist/graphql/fragments/index.js +21 -0
  42. package/dist/graphql/fragments/index.js.map +1 -0
  43. package/dist/graphql/fragments/pageinfo.fragment.d.ts +33 -0
  44. package/dist/graphql/fragments/pageinfo.fragment.d.ts.map +1 -0
  45. package/dist/graphql/fragments/pageinfo.fragment.js +47 -0
  46. package/dist/graphql/fragments/pageinfo.fragment.js.map +1 -0
  47. package/dist/graphql/fragments/transaction-base.fragment.d.ts +19 -0
  48. package/dist/graphql/fragments/transaction-base.fragment.d.ts.map +1 -0
  49. package/dist/graphql/fragments/transaction-base.fragment.js +32 -0
  50. package/dist/graphql/fragments/transaction-base.fragment.js.map +1 -0
  51. package/dist/graphql/fragments/vault-list.fragment.d.ts +53 -0
  52. package/dist/graphql/fragments/vault-list.fragment.d.ts.map +1 -0
  53. package/dist/graphql/fragments/vault-list.fragment.js +51 -0
  54. package/dist/graphql/fragments/vault-list.fragment.js.map +1 -0
  55. package/dist/graphql/fragments/vault-summary.fragment.d.ts +68 -0
  56. package/dist/graphql/fragments/vault-summary.fragment.d.ts.map +1 -0
  57. package/dist/graphql/fragments/vault-summary.fragment.js +66 -0
  58. package/dist/graphql/fragments/vault-summary.fragment.js.map +1 -0
  59. package/dist/graphql/fragments/vault.fragment.d.ts +133 -0
  60. package/dist/graphql/fragments/vault.fragment.d.ts.map +1 -0
  61. package/dist/graphql/fragments/vault.fragment.js +119 -0
  62. package/dist/graphql/fragments/vault.fragment.js.map +1 -0
  63. package/dist/graphql/fragments.d.ts +183 -0
  64. package/dist/graphql/fragments.d.ts.map +1 -0
  65. package/dist/graphql/fragments.js +297 -0
  66. package/dist/graphql/fragments.js.map +1 -0
  67. package/dist/graphql/queries/export.queries.d.ts +72 -0
  68. package/dist/graphql/queries/export.queries.d.ts.map +1 -0
  69. package/dist/graphql/queries/export.queries.js +202 -0
  70. package/dist/graphql/queries/export.queries.js.map +1 -0
  71. package/dist/graphql/queries/index.d.ts +15 -0
  72. package/dist/graphql/queries/index.d.ts.map +1 -0
  73. package/dist/graphql/queries/index.js +23 -0
  74. package/dist/graphql/queries/index.js.map +1 -0
  75. package/dist/graphql/queries/performance.queries.d.ts +63 -0
  76. package/dist/graphql/queries/performance.queries.d.ts.map +1 -0
  77. package/dist/graphql/queries/performance.queries.js +133 -0
  78. package/dist/graphql/queries/performance.queries.js.map +1 -0
  79. package/dist/graphql/queries/period-summaries.d.ts +15 -0
  80. package/dist/graphql/queries/period-summaries.d.ts.map +1 -0
  81. package/dist/graphql/queries/period-summaries.js +24 -0
  82. package/dist/graphql/queries/period-summaries.js.map +1 -0
  83. package/dist/graphql/queries/portfolio.queries.d.ts +78 -0
  84. package/dist/graphql/queries/portfolio.queries.d.ts.map +1 -0
  85. package/dist/graphql/queries/portfolio.queries.js +198 -0
  86. package/dist/graphql/queries/portfolio.queries.js.map +1 -0
  87. package/dist/graphql/queries/prediction.queries.d.ts +38 -0
  88. package/dist/graphql/queries/prediction.queries.d.ts.map +1 -0
  89. package/dist/graphql/queries/prediction.queries.js +100 -0
  90. package/dist/graphql/queries/prediction.queries.js.map +1 -0
  91. package/dist/graphql/queries/risk.queries.d.ts +37 -0
  92. package/dist/graphql/queries/risk.queries.d.ts.map +1 -0
  93. package/dist/graphql/queries/risk.queries.js +90 -0
  94. package/dist/graphql/queries/risk.queries.js.map +1 -0
  95. package/dist/graphql/queries/search.queries.d.ts +61 -0
  96. package/dist/graphql/queries/search.queries.d.ts.map +1 -0
  97. package/dist/graphql/queries/search.queries.js +103 -0
  98. package/dist/graphql/queries/search.queries.js.map +1 -0
  99. package/dist/graphql/queries/transaction.queries.d.ts +60 -0
  100. package/dist/graphql/queries/transaction.queries.d.ts.map +1 -0
  101. package/dist/graphql/queries/transaction.queries.js +252 -0
  102. package/dist/graphql/queries/transaction.queries.js.map +1 -0
  103. package/dist/graphql/queries/vault.queries.d.ts +54 -0
  104. package/dist/graphql/queries/vault.queries.d.ts.map +1 -0
  105. package/dist/graphql/queries/vault.queries.js +78 -0
  106. package/dist/graphql/queries/vault.queries.js.map +1 -0
  107. package/dist/index.d.ts +12 -0
  108. package/dist/index.d.ts.map +1 -0
  109. package/dist/index.js +32 -0
  110. package/dist/index.js.map +1 -0
  111. package/dist/prompts/competitor-comparison.d.ts +8 -0
  112. package/dist/prompts/competitor-comparison.d.ts.map +1 -0
  113. package/dist/prompts/competitor-comparison.js +432 -0
  114. package/dist/prompts/competitor-comparison.js.map +1 -0
  115. package/dist/prompts/curator-performance.d.ts +8 -0
  116. package/dist/prompts/curator-performance.d.ts.map +1 -0
  117. package/dist/prompts/curator-performance.js +383 -0
  118. package/dist/prompts/curator-performance.js.map +1 -0
  119. package/dist/prompts/financial-analysis.d.ts +8 -0
  120. package/dist/prompts/financial-analysis.d.ts.map +1 -0
  121. package/dist/prompts/financial-analysis.js +480 -0
  122. package/dist/prompts/financial-analysis.js.map +1 -0
  123. package/dist/prompts/index.d.ts +21 -0
  124. package/dist/prompts/index.d.ts.map +1 -0
  125. package/dist/prompts/index.js +50 -0
  126. package/dist/prompts/index.js.map +1 -0
  127. package/dist/prompts/onboarding-first-vault.d.ts +8 -0
  128. package/dist/prompts/onboarding-first-vault.d.ts.map +1 -0
  129. package/dist/prompts/onboarding-first-vault.js +317 -0
  130. package/dist/prompts/onboarding-first-vault.js.map +1 -0
  131. package/dist/prompts/portfolio-optimization.d.ts +8 -0
  132. package/dist/prompts/portfolio-optimization.d.ts.map +1 -0
  133. package/dist/prompts/portfolio-optimization.js +412 -0
  134. package/dist/prompts/portfolio-optimization.js.map +1 -0
  135. package/dist/prompts/protocol-overview.d.ts +8 -0
  136. package/dist/prompts/protocol-overview.d.ts.map +1 -0
  137. package/dist/prompts/protocol-overview.js +398 -0
  138. package/dist/prompts/protocol-overview.js.map +1 -0
  139. package/dist/prompts/shared/disclaimers.d.ts +54 -0
  140. package/dist/prompts/shared/disclaimers.d.ts.map +1 -0
  141. package/dist/prompts/shared/disclaimers.js +400 -0
  142. package/dist/prompts/shared/disclaimers.js.map +1 -0
  143. package/dist/resources/glossary.d.ts +8 -0
  144. package/dist/resources/glossary.d.ts.map +1 -0
  145. package/dist/resources/glossary.js +407 -0
  146. package/dist/resources/glossary.js.map +1 -0
  147. package/dist/resources/index.d.ts +18 -0
  148. package/dist/resources/index.d.ts.map +1 -0
  149. package/dist/resources/index.js +29 -0
  150. package/dist/resources/index.js.map +1 -0
  151. package/dist/resources/schema.d.ts +22 -0
  152. package/dist/resources/schema.d.ts.map +1 -0
  153. package/dist/resources/schema.js +67 -0
  154. package/dist/resources/schema.js.map +1 -0
  155. package/dist/schemas/config.schema.d.ts +46 -0
  156. package/dist/schemas/config.schema.d.ts.map +1 -0
  157. package/dist/schemas/config.schema.js +48 -0
  158. package/dist/schemas/config.schema.js.map +1 -0
  159. package/dist/sdk/__tests__/apr-service.test.d.ts +7 -0
  160. package/dist/sdk/__tests__/apr-service.test.d.ts.map +1 -0
  161. package/dist/sdk/__tests__/apr-service.test.js +385 -0
  162. package/dist/sdk/__tests__/apr-service.test.js.map +1 -0
  163. package/dist/sdk/__tests__/math-utils.test.d.ts +7 -0
  164. package/dist/sdk/__tests__/math-utils.test.d.ts.map +1 -0
  165. package/dist/sdk/__tests__/math-utils.test.js +185 -0
  166. package/dist/sdk/__tests__/math-utils.test.js.map +1 -0
  167. package/dist/sdk/__tests__/simulation-service.test.d.ts +5 -0
  168. package/dist/sdk/__tests__/simulation-service.test.d.ts.map +1 -0
  169. package/dist/sdk/__tests__/simulation-service.test.js +397 -0
  170. package/dist/sdk/__tests__/simulation-service.test.js.map +1 -0
  171. package/dist/sdk/__tests__/vault-utils.test.d.ts +7 -0
  172. package/dist/sdk/__tests__/vault-utils.test.d.ts.map +1 -0
  173. package/dist/sdk/__tests__/vault-utils.test.js +189 -0
  174. package/dist/sdk/__tests__/vault-utils.test.js.map +1 -0
  175. package/dist/sdk/apr-service.d.ts +101 -0
  176. package/dist/sdk/apr-service.d.ts.map +1 -0
  177. package/dist/sdk/apr-service.js +175 -0
  178. package/dist/sdk/apr-service.js.map +1 -0
  179. package/dist/sdk/math-utils.d.ts +138 -0
  180. package/dist/sdk/math-utils.d.ts.map +1 -0
  181. package/dist/sdk/math-utils.js +218 -0
  182. package/dist/sdk/math-utils.js.map +1 -0
  183. package/dist/sdk/simulation-service.d.ts +106 -0
  184. package/dist/sdk/simulation-service.d.ts.map +1 -0
  185. package/dist/sdk/simulation-service.js +143 -0
  186. package/dist/sdk/simulation-service.js.map +1 -0
  187. package/dist/sdk/vault-utils.d.ts +125 -0
  188. package/dist/sdk/vault-utils.d.ts.map +1 -0
  189. package/dist/sdk/vault-utils.js +165 -0
  190. package/dist/sdk/vault-utils.js.map +1 -0
  191. package/dist/server.d.ts +21 -0
  192. package/dist/server.d.ts.map +1 -0
  193. package/dist/server.js +225 -0
  194. package/dist/server.js.map +1 -0
  195. package/dist/services/analytics/protocol-overview.service.d.ts +61 -0
  196. package/dist/services/analytics/protocol-overview.service.d.ts.map +1 -0
  197. package/dist/services/analytics/protocol-overview.service.js +182 -0
  198. package/dist/services/analytics/protocol-overview.service.js.map +1 -0
  199. package/dist/services/analytics/risk.service.d.ts +92 -0
  200. package/dist/services/analytics/risk.service.d.ts.map +1 -0
  201. package/dist/services/analytics/risk.service.js +423 -0
  202. package/dist/services/analytics/risk.service.js.map +1 -0
  203. package/dist/services/base.service.d.ts +39 -0
  204. package/dist/services/base.service.d.ts.map +1 -0
  205. package/dist/services/base.service.js +37 -0
  206. package/dist/services/base.service.js.map +1 -0
  207. package/dist/services/index.d.ts +30 -0
  208. package/dist/services/index.d.ts.map +1 -0
  209. package/dist/services/index.js +101 -0
  210. package/dist/services/index.js.map +1 -0
  211. package/dist/tools/__tests__/simulate-vault.test.d.ts +5 -0
  212. package/dist/tools/__tests__/simulate-vault.test.d.ts.map +1 -0
  213. package/dist/tools/__tests__/simulate-vault.test.js +363 -0
  214. package/dist/tools/__tests__/simulate-vault.test.js.map +1 -0
  215. package/dist/tools/analyze-risk.d.ts +34 -0
  216. package/dist/tools/analyze-risk.d.ts.map +1 -0
  217. package/dist/tools/analyze-risk.js +100 -0
  218. package/dist/tools/analyze-risk.js.map +1 -0
  219. package/dist/tools/compare-vaults.d.ts +29 -0
  220. package/dist/tools/compare-vaults.d.ts.map +1 -0
  221. package/dist/tools/compare-vaults.js +285 -0
  222. package/dist/tools/compare-vaults.js.map +1 -0
  223. package/dist/tools/export-data.d.ts +34 -0
  224. package/dist/tools/export-data.d.ts.map +1 -0
  225. package/dist/tools/export-data.js +309 -0
  226. package/dist/tools/export-data.js.map +1 -0
  227. package/dist/tools/get-price-history.d.ts +29 -0
  228. package/dist/tools/get-price-history.d.ts.map +1 -0
  229. package/dist/tools/get-price-history.js +236 -0
  230. package/dist/tools/get-price-history.js.map +1 -0
  231. package/dist/tools/get-transactions.d.ts +29 -0
  232. package/dist/tools/get-transactions.d.ts.map +1 -0
  233. package/dist/tools/get-transactions.js +181 -0
  234. package/dist/tools/get-transactions.js.map +1 -0
  235. package/dist/tools/index.d.ts +26 -0
  236. package/dist/tools/index.d.ts.map +1 -0
  237. package/dist/tools/index.js +32 -0
  238. package/dist/tools/index.js.map +1 -0
  239. package/dist/tools/optimize-portfolio.d.ts +37 -0
  240. package/dist/tools/optimize-portfolio.d.ts.map +1 -0
  241. package/dist/tools/optimize-portfolio.js +459 -0
  242. package/dist/tools/optimize-portfolio.js.map +1 -0
  243. package/dist/tools/predict-yield.d.ts +30 -0
  244. package/dist/tools/predict-yield.d.ts.map +1 -0
  245. package/dist/tools/predict-yield.js +248 -0
  246. package/dist/tools/predict-yield.js.map +1 -0
  247. package/dist/tools/query-graphql.d.ts +35 -0
  248. package/dist/tools/query-graphql.d.ts.map +1 -0
  249. package/dist/tools/query-graphql.js +54 -0
  250. package/dist/tools/query-graphql.js.map +1 -0
  251. package/dist/tools/registry.d.ts +42 -0
  252. package/dist/tools/registry.d.ts.map +1 -0
  253. package/dist/tools/registry.js +231 -0
  254. package/dist/tools/registry.js.map +1 -0
  255. package/dist/tools/search-vaults.d.ts +40 -0
  256. package/dist/tools/search-vaults.d.ts.map +1 -0
  257. package/dist/tools/search-vaults.js +184 -0
  258. package/dist/tools/search-vaults.js.map +1 -0
  259. package/dist/tools/simulate-vault.d.ts +80 -0
  260. package/dist/tools/simulate-vault.d.ts.map +1 -0
  261. package/dist/tools/simulate-vault.js +281 -0
  262. package/dist/tools/simulate-vault.js.map +1 -0
  263. package/dist/tools/user-portfolio.d.ts +30 -0
  264. package/dist/tools/user-portfolio.d.ts.map +1 -0
  265. package/dist/tools/user-portfolio.js +142 -0
  266. package/dist/tools/user-portfolio.js.map +1 -0
  267. package/dist/tools/vault-data.d.ts +23 -0
  268. package/dist/tools/vault-data.d.ts.map +1 -0
  269. package/dist/tools/vault-data.js +68 -0
  270. package/dist/tools/vault-data.js.map +1 -0
  271. package/dist/tools/vault-performance.d.ts +30 -0
  272. package/dist/tools/vault-performance.d.ts.map +1 -0
  273. package/dist/tools/vault-performance.js +275 -0
  274. package/dist/tools/vault-performance.js.map +1 -0
  275. package/dist/types/generated.d.ts +1109 -0
  276. package/dist/types/generated.d.ts.map +1 -0
  277. package/dist/types/generated.js +2 -0
  278. package/dist/types/generated.js.map +1 -0
  279. package/dist/types/index.d.ts +46 -0
  280. package/dist/types/index.d.ts.map +1 -0
  281. package/dist/types/index.js +8 -0
  282. package/dist/types/index.js.map +1 -0
  283. package/dist/utils/comparison-metrics.d.ts +120 -0
  284. package/dist/utils/comparison-metrics.d.ts.map +1 -0
  285. package/dist/utils/comparison-metrics.js +215 -0
  286. package/dist/utils/comparison-metrics.js.map +1 -0
  287. package/dist/utils/config-loader.d.ts +17 -0
  288. package/dist/utils/config-loader.d.ts.map +1 -0
  289. package/dist/utils/config-loader.js +45 -0
  290. package/dist/utils/config-loader.js.map +1 -0
  291. package/dist/utils/csv-generator.d.ts +89 -0
  292. package/dist/utils/csv-generator.d.ts.map +1 -0
  293. package/dist/utils/csv-generator.js +97 -0
  294. package/dist/utils/csv-generator.js.map +1 -0
  295. package/dist/utils/disclaimers.d.ts +70 -0
  296. package/dist/utils/disclaimers.d.ts.map +1 -0
  297. package/dist/utils/disclaimers.js +161 -0
  298. package/dist/utils/disclaimers.js.map +1 -0
  299. package/dist/utils/errors.d.ts +66 -0
  300. package/dist/utils/errors.d.ts.map +1 -0
  301. package/dist/utils/errors.js +86 -0
  302. package/dist/utils/errors.js.map +1 -0
  303. package/dist/utils/execute-tool-with-cache.d.ts +97 -0
  304. package/dist/utils/execute-tool-with-cache.d.ts.map +1 -0
  305. package/dist/utils/execute-tool-with-cache.js +105 -0
  306. package/dist/utils/execute-tool-with-cache.js.map +1 -0
  307. package/dist/utils/portfolio-optimization.d.ts +100 -0
  308. package/dist/utils/portfolio-optimization.d.ts.map +1 -0
  309. package/dist/utils/portfolio-optimization.js +283 -0
  310. package/dist/utils/portfolio-optimization.js.map +1 -0
  311. package/dist/utils/risk-scoring.d.ts +226 -0
  312. package/dist/utils/risk-scoring.d.ts.map +1 -0
  313. package/dist/utils/risk-scoring.js +523 -0
  314. package/dist/utils/risk-scoring.js.map +1 -0
  315. package/dist/utils/tool-error-handler.d.ts +16 -0
  316. package/dist/utils/tool-error-handler.d.ts.map +1 -0
  317. package/dist/utils/tool-error-handler.js +43 -0
  318. package/dist/utils/tool-error-handler.js.map +1 -0
  319. package/dist/utils/tool-handler.d.ts +33 -0
  320. package/dist/utils/tool-handler.d.ts.map +1 -0
  321. package/dist/utils/tool-handler.js +59 -0
  322. package/dist/utils/tool-handler.js.map +1 -0
  323. package/dist/utils/tool-response.d.ts +16 -0
  324. package/dist/utils/tool-response.d.ts.map +1 -0
  325. package/dist/utils/tool-response.js +25 -0
  326. package/dist/utils/tool-response.js.map +1 -0
  327. package/dist/utils/validators.d.ts +359 -0
  328. package/dist/utils/validators.d.ts.map +1 -0
  329. package/dist/utils/validators.js +233 -0
  330. package/dist/utils/validators.js.map +1 -0
  331. package/dist/utils/yield-prediction.d.ts +69 -0
  332. package/dist/utils/yield-prediction.d.ts.map +1 -0
  333. package/dist/utils/yield-prediction.js +290 -0
  334. package/dist/utils/yield-prediction.js.map +1 -0
  335. package/package.json +83 -0
package/README.md ADDED
@@ -0,0 +1,618 @@
1
+ # Lagoon MCP Server
2
+
3
+ Model Context Protocol (MCP) server providing Claude Code with conversational access to Lagoon DeFi vault analytics.
4
+
5
+ ## Overview
6
+
7
+ Lagoon MCP enables natural language queries about DeFi vaults, user portfolios, and performance metrics through Claude Code. Query vault data, analyze portfolios, and generate financial reports without writing GraphQL manually.
8
+
9
+ **Key Features**:
10
+ - 🔍 **Vault Discovery** - Search and filter vaults by asset, chain, TVL, and more
11
+ - 📊 **Portfolio Analysis** - Cross-chain portfolio aggregation and analysis
12
+ - 📈 **Performance Tracking** - Historical metrics and trend analysis
13
+ - ⚡ **Smart Caching** - Optimized response times with intelligent caching
14
+ - 🔒 **Type-Safe** - Full TypeScript type safety from GraphQL to Claude
15
+ - 📚 **Rich Resources** - GraphQL schema introspection and DeFi terminology guide
16
+ - 🎯 **Smart Prompts** - Financial analysis guidance with best practices
17
+
18
+ ## Quick Start
19
+
20
+ ### Prerequisites
21
+
22
+ - Node.js ≥18.0.0
23
+ - Claude Desktop app
24
+ - Access to Lagoon backend GraphQL endpoint
25
+
26
+ ### Installation (will be updated after publishing)
27
+
28
+ ```bash
29
+ # Install globally
30
+ npm install -g @hopperlabsxyz/lagoon-mcp
31
+
32
+ # Or install locally
33
+ npm install @hopperlabsxyz/lagoon-mcp
34
+ ```
35
+
36
+ ### Configuration
37
+
38
+ #### Supported Platforms
39
+
40
+ | Platform | Status | Config Format | Documentation |
41
+ |----------|--------|---------------|---------------|
42
+ | **Claude Desktop** | ✅ Available Now | JSON | [↓ See below](#claude-desktop) |
43
+ | **Claude Code (CLI)** | ✅ Available Now | JSON | [↓ See below](#claude-code-cli) |
44
+ | **OpenAI Agents SDK** | ✅ Available Now | YAML | [↓ See below](#openai-agents-sdk) |
45
+ | **ChatGPT Desktop** | ⏳ Coming Soon | JSON (expected) | [↓ See below](#chatgpt-desktop) |
46
+ | **Grok** | ❌ Not Supported | N/A | No native MCP support |
47
+
48
+ ---
49
+
50
+ #### Claude Desktop
51
+
52
+ Add to your Claude Desktop config file:
53
+
54
+ **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
55
+ **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
56
+
57
+ ```json
58
+ {
59
+ "mcpServers": {
60
+ "lagoon": {
61
+ "command": "lagoon-mcp",
62
+ "env": {
63
+ "LAGOON_GRAPHQL_URL": "https://api.lagoon.finance/query"
64
+ }
65
+ }
66
+ }
67
+ }
68
+ ```
69
+
70
+ **Local development**:
71
+ ```json
72
+ {
73
+ "mcpServers": {
74
+ "lagoon": {
75
+ "command": "node",
76
+ "args": ["/path/to/lagoon-mcp/dist/index.js"],
77
+ "env": {
78
+ "LAGOON_GRAPHQL_URL": "http://localhost:3000/query"
79
+ }
80
+ }
81
+ }
82
+ }
83
+ ```
84
+
85
+ ---
86
+
87
+ #### Claude Code (CLI)
88
+
89
+ **Configuration file**: `~/.claude.json` (project-based configuration)
90
+
91
+ Claude Code CLI uses a project-scoped configuration system. You can configure MCP servers in two ways:
92
+
93
+ ##### Option 1: Project-Specific Configuration (~/.claude.json)
94
+
95
+ Edit your `~/.claude.json` file and add lagoon-mcp to your project:
96
+
97
+ **For production use** (after `npm install -g @hopperlabsxyz/lagoon-mcp`):
98
+
99
+ ```json
100
+ {
101
+ "projects": {
102
+ "/path/to/your/project": {
103
+ "mcpServers": {
104
+ "lagoon": {
105
+ "type": "stdio",
106
+ "command": "lagoon-mcp",
107
+ "env": {
108
+ "LAGOON_GRAPHQL_URL": "https://api.lagoon.finance/query"
109
+ }
110
+ }
111
+ }
112
+ }
113
+ }
114
+ }
115
+ ```
116
+
117
+ **For local development**:
118
+
119
+ ```json
120
+ {
121
+ "projects": {
122
+ "/path/to/your/project": {
123
+ "mcpServers": {
124
+ "lagoon": {
125
+ "type": "stdio",
126
+ "command": "node",
127
+ "args": ["/absolute/path/to/lagoon-mcp/dist/index.js"],
128
+ "env": {
129
+ "LAGOON_GRAPHQL_URL": "http://localhost:3000/query"
130
+ }
131
+ }
132
+ }
133
+ }
134
+ }
135
+ }
136
+ ```
137
+
138
+ ##### Option 2: Team Collaboration (.mcp.json)
139
+
140
+ Create a `.mcp.json` file in your project root for team-wide configuration:
141
+
142
+ ```json
143
+ {
144
+ "mcpServers": {
145
+ "lagoon": {
146
+ "type": "stdio",
147
+ "command": "lagoon-mcp",
148
+ "env": {
149
+ "LAGOON_GRAPHQL_URL": "https://api.lagoon.finance/query"
150
+ }
151
+ }
152
+ }
153
+ }
154
+ ```
155
+
156
+ This file can be committed to version control for consistent team setup.
157
+
158
+ **After configuration**: Restart Claude Code and use `/mcp` command to verify lagoon appears in the server list.
159
+
160
+ **Note**: Claude Code CLI uses different config files than Claude Desktop. See [FAQ](#faq) for details.
161
+
162
+ ---
163
+
164
+ #### OpenAI Agents SDK
165
+
166
+ For developers using the [OpenAI Agents SDK](https://openai.github.io/openai-agents-js/guides/mcp/), create `mcp_agent.config.yaml`:
167
+
168
+ ```yaml
169
+ $schema: "https://raw.githubusercontent.com/lastmile-ai/mcp-agent/main/schema/mcp-agent.config.schema.json"
170
+ mcp:
171
+ servers:
172
+ lagoon:
173
+ command: "lagoon-mcp"
174
+ env:
175
+ LAGOON_GRAPHQL_URL: "https://api.lagoon.finance/query"
176
+ ```
177
+
178
+ **Python SDK Usage**:
179
+ ```python
180
+ from agents.mcp import MCPServerStdio
181
+
182
+ lagoon_server = MCPServerStdio(
183
+ params={
184
+ "command": "lagoon-mcp",
185
+ "env": {
186
+ "LAGOON_GRAPHQL_URL": "https://api.lagoon.finance/query"
187
+ }
188
+ },
189
+ name="lagoon"
190
+ )
191
+ ```
192
+
193
+ **TypeScript SDK Usage**:
194
+ ```typescript
195
+ import { MCPServerStdio } from '@openai/openai-agents-mcp';
196
+
197
+ const lagoonServer = new MCPServerStdio({
198
+ command: 'lagoon-mcp',
199
+ env: {
200
+ LAGOON_GRAPHQL_URL: 'https://api.lagoon.finance/query'
201
+ }
202
+ });
203
+ ```
204
+
205
+ **Note**: This is for API developers building custom applications, not end-user desktop usage.
206
+
207
+ ---
208
+
209
+ #### ChatGPT Desktop
210
+
211
+ **Status**: MCP support for ChatGPT Desktop is currently in development and expected "in the coming months" per OpenAI.
212
+
213
+ **Availability**:
214
+ - ⏳ Desktop app with MCP: Not yet released
215
+ - ⏳ Enterprise/Team: Limited beta access only
216
+ - ❌ Individual ChatGPT Plus: Not available yet
217
+
218
+ **Expected Configuration** (once available):
219
+
220
+ Configuration file location will likely follow a similar pattern to Claude Desktop (exact location TBD).
221
+
222
+ ```json
223
+ {
224
+ "mcpServers": {
225
+ "lagoon": {
226
+ "command": "lagoon-mcp",
227
+ "env": {
228
+ "LAGOON_GRAPHQL_URL": "https://api.lagoon.finance/query"
229
+ }
230
+ }
231
+ }
232
+ }
233
+ ```
234
+
235
+ **Technical Note**: The lagoon-mcp server is already compatible with ChatGPT's MCP implementation (uses standard MCP protocol and stdio transport). No code changes will be needed once ChatGPT Desktop launches with MCP support
236
+
237
+ ### Usage
238
+
239
+ Restart Claude Desktop and start asking questions:
240
+
241
+ ```
242
+ "Show me my portfolio for wallet 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
243
+
244
+ "Find all USDC vaults on Arbitrum with more than $1M TVL"
245
+
246
+ "How has the lgUSDC vault on Arbitrum performed over the last 30 days?"
247
+
248
+ "What are the top 5 vaults by TVL across all chains?"
249
+ ```
250
+
251
+ ## ⚠️ Important Legal Disclaimer
252
+
253
+ **THIS TOOL PROVIDES INFORMATIONAL CONTENT ONLY - NOT FINANCIAL ADVICE**
254
+
255
+ Lagoon MCP is a data analysis tool that provides information about DeFi vaults. **All analysis outputs are for educational and informational purposes only** and should NOT be interpreted as:
256
+
257
+ - Financial, investment, legal, or tax advice
258
+ - Recommendations to buy, sell, hold, or trade any asset
259
+ - Guarantees of future performance or returns
260
+ - Professional financial guidance
261
+
262
+ ### Your Responsibilities
263
+
264
+ Before making ANY investment decisions:
265
+
266
+ 1. **Conduct Independent Research**: Verify all data independently
267
+ 2. **Consult Professionals**: Seek advice from qualified financial, legal, and tax advisors
268
+ 3. **Understand Risks**: DeFi and cryptocurrency investments carry substantial risks including:
269
+ - Complete loss of invested capital
270
+ - Smart contract vulnerabilities
271
+ - Market volatility and illiquidity
272
+ - Regulatory uncertainty
273
+ 4. **Invest Responsibly**: Only invest what you can afford to lose completely
274
+
275
+ ### No Warranties or Guarantees
276
+
277
+ We provide this software "AS IS" without warranties of any kind. We:
278
+ - Make no guarantees about data accuracy, completeness, or timeliness
279
+ - Accept no liability for investment losses or damages
280
+ - Do not endorse any specific vaults, protocols, or strategies
281
+ - Disclaim all responsibility for third-party platform performance
282
+
283
+ **Past performance does not predict future results.** Market conditions change rapidly.
284
+
285
+ ---
286
+
287
+ ## Available Tools
288
+
289
+ Complete tool documentation available in [docs/tools/](./docs/tools/).
290
+
291
+ | Tool | Description | Documentation |
292
+ |------|-------------|---------------|
293
+ | **query_graphql** | Execute raw GraphQL queries for advanced use cases | [→ Details](./docs/tools/query-graphql.md) |
294
+ | **get_vault_data** | Get comprehensive vault information by address and chain | [→ Details](./docs/tools/get-vault-data.md) |
295
+ | **get_user_portfolio** | Aggregate user holdings across all supported chains | [→ Details](./docs/tools/user-portfolio.md) |
296
+ | **search_vaults** | Search and filter vaults with 20+ advanced criteria | [→ Details](./docs/tools/search-vaults.md) |
297
+ | **get_vault_performance** | Historical metrics and performance analysis | [→ Details](./docs/tools/vault-performance.md) |
298
+ | **get_transactions** | Query vault transaction history with flexible filtering | [→ Details](./docs/tools/get-transactions.md) |
299
+ | **compare_vaults** | Side-by-side vault comparison with 12-factor risk analysis and rankings | [→ Details](./docs/tools/compare-vaults.md) |
300
+ | **optimize_portfolio** | Modern Portfolio Theory optimization with yield sustainability warnings | [→ Details](./docs/tools/optimize-portfolio.md) |
301
+ | **get_price_history** | Historical share price data with OHLCV time-series | [→ Details](./docs/tools/price-history.md) |
302
+ | **export_data** | Export vault data in CSV/JSON format | [→ Details](./docs/tools/export-data.md) |
303
+ | **analyze_risk** | Multi-factor risk analysis with comprehensive scoring | [→ Details](./docs/tools/analyze-risk.md) |
304
+ | **predict_yield** | ML-based yield forecasting with confidence intervals | [→ Details](./docs/tools/predict-yield.md) |
305
+
306
+ **See also**: [Tool Selection Guide](./docs/tools/README.md#tool-selection-guide) | [Common Workflows](./docs/tools/README.md#common-workflows)
307
+
308
+ ## Quick Examples
309
+
310
+ ### Basic Vault Analysis
311
+ ```
312
+ "Show me vault details for 0x1234... on Arbitrum"
313
+ → Returns comprehensive vault data with current metrics
314
+
315
+ "How has this vault performed over the last 30 days?"
316
+ → Returns TVL history, growth metrics, and trend analysis
317
+ ```
318
+
319
+ ### Portfolio Management
320
+ ```
321
+ "Analyze my portfolio at 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
322
+ → Returns cross-chain positions sorted by USD value
323
+
324
+ "What's my total exposure to USDC vaults?"
325
+ → Aggregates all USDC positions across chains
326
+ ```
327
+
328
+ ### Advanced Analytics
329
+ ```
330
+ "Compare these 3 vaults and tell me which has the best risk-adjusted returns"
331
+ → Returns comparison table with rankings and metrics
332
+
333
+ "Analyze the risk profile for vault 0x1234..."
334
+ → Returns multi-factor risk breakdown with insights
335
+
336
+ "Predict future yields for lgUSDC based on 90-day history"
337
+ → Returns ML-based forecast with confidence intervals
338
+ ```
339
+
340
+ ### Data Export & Reporting
341
+ ```
342
+ "Export the top 10 vaults by TVL as CSV"
343
+ → Returns formatted CSV data for spreadsheet analysis
344
+
345
+ "Get transaction history for vault 0x1234... and export as JSON"
346
+ → Returns structured transaction data for external tools
347
+ ```
348
+
349
+ ## Resources & Prompts
350
+
351
+ ### Resources
352
+
353
+ - **GraphQL Schema** (`lagoon://graphql-schema`) - Complete GraphQL schema in SDL format with 24-hour caching
354
+ - **DeFi Glossary** (`lagoon://defi-glossary`) - Comprehensive terminology guide for Lagoon DeFi Protocol (500+ lines)
355
+
356
+ ### Prompts
357
+
358
+ Prompts are self-explanatory templates invoked by name. See [Prompt Guidelines](./docs/prompts/README.md) for usage patterns.
359
+
360
+ | Prompt | Description |
361
+ |--------|-------------|
362
+ | **financial-analysis** | Guidance for analyzing DeFi vault data and generating financial insights with risk assessment frameworks |
363
+ | **curator-performance** | Comprehensive framework for evaluating curator performance, reputation, and vault management capabilities |
364
+ | **competitor-comparison** | Objective comparison of Lagoon Protocol against major competitors with data-driven analysis |
365
+ | **onboarding-first-vault** | Structured guidance for new users making their first vault deposit with risk profile assessment |
366
+ | **protocol-overview** | Real-time protocol health insights and KPI dashboard tracking TVL, growth, and ecosystem health |
367
+ | **portfolio-optimization** | AI-powered portfolio optimization based on modern portfolio theory with systematic rebalancing |
368
+
369
+ **Usage**: Invoke prompts by name in Claude (e.g., "Use the financial-analysis prompt to evaluate this vault")
370
+
371
+ **See also**: [Disclaimer Standards](./docs/prompts/DISCLAIMER_STANDARDS.md)
372
+
373
+ ## Development
374
+
375
+ For development setup, testing, and contributing guidelines, see [DEVELOPMENT.md](./docs/DEVELOPMENT.md).
376
+
377
+ ### Quick Start
378
+
379
+ ```bash
380
+ # Clone and setup
381
+ git clone https://github.com/hopperlabsxyz/lagoon-mcp.git
382
+ cd lagoon-mcp
383
+ npm install
384
+
385
+ # Generate types from GraphQL schema
386
+ npm run codegen
387
+
388
+ # Build the project
389
+ npm run build
390
+
391
+ # Run in development mode
392
+ npm run dev
393
+
394
+ # Run tests
395
+ npm test
396
+ ```
397
+
398
+ ### Project Structure
399
+
400
+ ```
401
+ lagoon-mcp/
402
+ ├── docs/
403
+ │ ├── DEVELOPMENT.md # Development guide
404
+ │ └── tools/ # Individual tool documentation
405
+ ├── src/
406
+ │ ├── tools/ # Tool implementations
407
+ │ ├── resources/ # MCP resources
408
+ │ ├── prompts/ # MCP prompts
409
+ │ ├── graphql/ # GraphQL client and fragments
410
+ │ ├── cache/ # Caching layer
411
+ │ └── utils/ # Utilities
412
+ ├── tests/ # Test suite
413
+ └── package.json
414
+ ```
415
+
416
+ ## Architecture
417
+
418
+ ### System Flow
419
+
420
+ ```
421
+ ┌─────────────┐ ┌──────────────┐ ┌─────────────┐
422
+ │ Claude │ ◄─MCP──►│ Lagoon MCP │◄─GraphQL─►│ Backend │
423
+ │ │ │ Server │ │ API │
424
+ └─────────────┘ └──────────────┘ └─────────────┘
425
+
426
+ │ Cache + DI
427
+
428
+ ┌──────────────┐
429
+ │ Container │
430
+ └──────────────┘
431
+ │ │ │
432
+ Cache Client Services
433
+ ```
434
+
435
+ ### Architecture Patterns
436
+
437
+ **Hybrid Service Layer**:
438
+ - **Direct GraphQL** for simple operations (12/13 tools)
439
+ - **Service Layer** for complex multi-step operations (e.g., RiskService)
440
+ - See [ADR-001](./docs/architecture/ADR-001-service-layer.md) for decision rationale
441
+
442
+ **Dependency Injection**:
443
+ - Centralized `ServiceContainer` with GraphQL client, cache, config
444
+ - Consistent tool creation via factory functions
445
+ - Easy testing with container mocking
446
+
447
+ **Type Safety**:
448
+ - GraphQL schema → TypeScript types via `graphql-codegen`
449
+ - Runtime validation with Zod schemas
450
+ - Strict TypeScript compilation (`noImplicitAny`, `strictNullChecks`)
451
+
452
+ ### Key Components
453
+
454
+ - **MCP Server**: Modern McpServer API with automatic capability management
455
+ - **GraphQL Client**: Communicates with Lagoon backend (`graphql-request`)
456
+ - **Type Generation**: Auto-generates TypeScript types (`graphql-codegen`)
457
+ - **Service Container**: Dependency injection with GraphQL client, cache, and config
458
+ - **Caching Layer**: In-memory cache with tag-based invalidation (`node-cache`)
459
+ - **Validation**: Runtime input validation (`zod`)
460
+ - **Services**: Complex operation encapsulation (e.g., `RiskService`)
461
+
462
+ ### Tool Architecture
463
+
464
+ ```typescript
465
+ // Simple tools use direct GraphQL
466
+ export function createExecuteGetVaultData(container: ServiceContainer) {
467
+ return executeToolWithCache({
468
+ container,
469
+ query: VAULT_QUERY,
470
+ cacheKey: (input) => `vault:${input.address}:${input.chainId}`,
471
+ cacheTTL: 900, // 15 minutes
472
+ // ...
473
+ });
474
+ }
475
+
476
+ // Complex tools use services
477
+ export function createExecuteAnalyzeRisk(container: ServiceContainer) {
478
+ const riskService = new RiskService(container);
479
+
480
+ return async (input) => {
481
+ const risk = await riskService.analyze(input.address, input.chainId);
482
+ return formatRiskOutput(risk);
483
+ };
484
+ }
485
+ ```
486
+
487
+ ### Caching Strategy
488
+
489
+ **Tiered TTL System** optimized for data volatility:
490
+
491
+ | Data Type | TTL | Rationale | Cache Tag |
492
+ |-----------|-----|-----------|-----------|
493
+ | Transactions | 5 min | Frequently changing | `TRANSACTION` |
494
+ | User portfolios | 5 min | Dynamic user holdings | `PORTFOLIO` |
495
+ | Search results | 10 min | Balance freshness/performance | `VAULT` |
496
+ | Vault data | 15 min | Relatively static | `VAULT` |
497
+ | Risk analysis | 15 min | Multi-factor metrics | `RISK` |
498
+ | Performance data | 30 min | Historical, less volatile | `PERFORMANCE` |
499
+ | Yield predictions | 60 min | ML forecasts valid longer | `PREDICTION` |
500
+ | Schema | 24 hours | Rarely changes | `SCHEMA` |
501
+
502
+ **Cache Invalidation**:
503
+ - Tag-based invalidation for related data
504
+ - Automatic expiration via TTL
505
+ - Manual invalidation on data mutations
506
+
507
+ ### Testing Strategy
508
+
509
+ **Multi-Layer Testing**:
510
+ - **Unit Tests**: Individual tool logic with mocked GraphQL
511
+ - **Integration Tests**: GraphQL client + real backend (optional)
512
+ - **SDK Tests**: Computation library (APR, simulation, math)
513
+ - **Coverage**: 80%+ enforced via vitest thresholds
514
+
515
+ **Performance Testing**:
516
+ - Cache hit rate monitoring (target: 60-70%)
517
+ - Response time tracking (~300-800 tokens per query)
518
+ - Concurrent request handling
519
+
520
+ ### Quality Assurance
521
+
522
+ - **TypeScript**: Strict mode with comprehensive type checking
523
+ - **ESLint**: Code quality and consistency rules
524
+ - **Prettier**: Automated code formatting
525
+ - **Vitest**: Fast unit and integration testing
526
+ - **Husky**: Pre-commit hooks with optimized test execution
527
+ - **Commitlint**: Conventional commit message enforcement
528
+
529
+ ### Architecture Decision Records
530
+
531
+ All major architectural decisions are documented in `docs/architecture/`:
532
+ - [ADR-001: Service Layer Pattern](./docs/architecture/ADR-001-service-layer.md) - Hybrid service layer rationale
533
+
534
+ ## Troubleshooting
535
+
536
+ ### Connection Errors
537
+
538
+ ```
539
+ Error: Request timeout
540
+ ```
541
+
542
+ **Solution**: Check `LAGOON_GRAPHQL_URL` environment variable and verify backend is running.
543
+
544
+ ### GraphQL Errors
545
+
546
+ ```
547
+ GraphQL Error: Vault not found
548
+ ```
549
+
550
+ **Solution**: Verify vault address and chain ID are correct. Use `query_graphql` tool to test raw queries.
551
+
552
+ ### Stale Cache Data
553
+
554
+ ```
555
+ Data seems outdated
556
+ ```
557
+
558
+ **Solution**: Cache TTLs are conservative. Restart MCP server to clear cache, or wait for TTL expiration.
559
+
560
+ ### Type Errors After Schema Update
561
+
562
+ ```
563
+ Type 'unknown' is not assignable to type 'Vault'
564
+ ```
565
+
566
+ **Solution**: Run `npm run codegen` to regenerate types from updated schema.
567
+
568
+ ## FAQ
569
+
570
+ **Q: Does this work with ChatGPT?**
571
+ A: Not yet for end users. ChatGPT Desktop MCP support is "coming in the coming months" per OpenAI. Currently available for API developers via OpenAI Agents SDK (YAML config format). See the [ChatGPT Desktop section](#chatgpt-desktop) above.
572
+
573
+ **Q: Does this work with Grok?**
574
+ A: No. xAI has not announced native MCP support for Grok, and there is no Grok desktop app with MCP capabilities. We recommend using Claude Desktop or waiting for ChatGPT Desktop MCP support.
575
+
576
+ **Q: Do I need to modify the code for different platforms?**
577
+ A: No! The lagoon-mcp server is already compatible with all MCP clients (uses standard MCP protocol and stdio transport). Only configuration format differs between platforms.
578
+
579
+ **Q: What's the difference between Claude Desktop and Claude Code CLI configuration?**
580
+ A: They use different config files:
581
+ - **Claude Desktop**: `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) - single global config
582
+ - **Claude Code CLI**: `~/.claude.json` (project-based) or `.mcp.json` (team sharing)
583
+ Make sure to edit the correct file for your platform!
584
+
585
+ **Q: Can I use this with other Claude clients?**
586
+ A: Yes! The MCP protocol is standard. Any MCP-compatible client should work (e.g., Cline, Cursor IDE)
587
+
588
+ **Q: Is there a rate limit?**
589
+ A: No rate limiting in MCP. Backend GraphQL API is public with no auth.
590
+
591
+ **Q: Can I add custom tools?**
592
+ A: Yes! Fork the repo, add your tool in `src/tools/`, and register in `src/tools/index.ts`.
593
+
594
+ **Q: How do I update to a new version?**
595
+ A: Run `npm update -g @hopperlabsxyz/lagoon-mcp` and restart Claude Desktop.
596
+
597
+ **Q: Does this work with all chains?**
598
+ A: Yes! Supports all chains available in the Lagoon backend (12+ networks).
599
+
600
+ ## License
601
+
602
+ MIT License - see [LICENSE](./LICENSE) for details
603
+
604
+ ## Support
605
+
606
+ - **Issues**: [GitHub Issues](https://github.com/hopperlabsxyz/lagoon-mcp/issues)
607
+ - **Discussions**: [GitHub Discussions](https://github.com/hopperlabsxyz/lagoon-mcp/discussions)
608
+ - **Documentation**: [Tool Docs](./docs/tools/) | [Development Guide](./docs/DEVELOPMENT.md)
609
+
610
+ ## Acknowledgments
611
+
612
+ - Built with [Model Context Protocol](https://modelcontextprotocol.io)
613
+ - Powered by [Anthropic Claude](https://claude.ai)
614
+ - GraphQL backend by [Lagoon Team](https://github.com/hopperlabsxyz/backend)
615
+
616
+ ---
617
+
618
+ **Made with ❤️ for the Lagoon DeFi community**