k-arena-mcp 1.0.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.
- package/index.js +54 -0
- package/package.json +11 -0
package/index.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { Server } = require('@modelcontextprotocol/sdk/server/index.js')
|
|
3
|
+
const { StdioServerTransport } = require('@modelcontextprotocol/sdk/server/stdio.js')
|
|
4
|
+
const { CallToolRequestSchema, ListToolsRequestSchema } = require('@modelcontextprotocol/sdk/types.js')
|
|
5
|
+
|
|
6
|
+
const BASE = 'https://karena.fieldnine.io'
|
|
7
|
+
|
|
8
|
+
const server = new Server(
|
|
9
|
+
{ name: 'k-arena', version: '1.0.0' },
|
|
10
|
+
{ capabilities: { tools: {} } }
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
14
|
+
tools: [
|
|
15
|
+
{ name: 'get_exchange_rates', description: 'Get real-time K-Arena exchange rates for all pairs (XAU, USD, ETH, BTC, OIL, EUR vs KAUS)', inputSchema: { type: 'object', properties: {} } },
|
|
16
|
+
{ name: 'get_platform_stats', description: 'Get K-Arena platform stats: volume, active agents, trades, KAUS price', inputSchema: { type: 'object', properties: {} } },
|
|
17
|
+
{ name: 'get_market_signals', description: 'Get AI-generated trading signals with confidence scores', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Number of signals (default 10)' } } } },
|
|
18
|
+
{ name: 'get_market_intelligence', description: 'Get Claude AI market analysis report', inputSchema: { type: 'object', properties: { type: { type: 'string', enum: ['market_summary', 'risk_alert', 'pair_analysis'] } } } },
|
|
19
|
+
{ name: 'get_genesis_status', description: 'Check Genesis 999 founding membership availability', inputSchema: { type: 'object', properties: {} } },
|
|
20
|
+
]
|
|
21
|
+
}))
|
|
22
|
+
|
|
23
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
24
|
+
const { name, arguments: args } = request.params
|
|
25
|
+
try {
|
|
26
|
+
let data
|
|
27
|
+
if (name === 'get_exchange_rates') {
|
|
28
|
+
const r = await fetch(`${BASE}/api/rates`)
|
|
29
|
+
data = await r.json()
|
|
30
|
+
} else if (name === 'get_platform_stats' || name === 'get_market_signals') {
|
|
31
|
+
const r = await fetch(`${BASE}/api/stats`)
|
|
32
|
+
const json = await r.json()
|
|
33
|
+
data = name === 'get_platform_stats' ? json.platform : (json.signals || []).slice(0, args?.limit || 10)
|
|
34
|
+
} else if (name === 'get_market_intelligence') {
|
|
35
|
+
const type = args?.type || 'market_summary'
|
|
36
|
+
const r = await fetch(`${BASE}/api/intelligence?type=${type}`)
|
|
37
|
+
data = await r.json()
|
|
38
|
+
} else if (name === 'get_genesis_status') {
|
|
39
|
+
const r = await fetch(`${BASE}/api/stats`)
|
|
40
|
+
const json = await r.json()
|
|
41
|
+
const { genesis_sold, genesis_total } = json.platform
|
|
42
|
+
data = { genesis_sold, genesis_total, remaining: genesis_total - genesis_sold, available: genesis_sold < genesis_total }
|
|
43
|
+
}
|
|
44
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] }
|
|
45
|
+
} catch (e) {
|
|
46
|
+
return { content: [{ type: 'text', text: `Error: ${e}` }], isError: true }
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
async function main() {
|
|
51
|
+
const transport = new StdioServerTransport()
|
|
52
|
+
await server.connect(transport)
|
|
53
|
+
}
|
|
54
|
+
main().catch(console.error)
|
package/package.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "k-arena-mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "K-Arena MCP server - AI-to-AI financial exchange",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": { "k-arena-mcp": "index.js" },
|
|
7
|
+
"scripts": { "start": "node index.js" },
|
|
8
|
+
"keywords": ["mcp","finance","trading","ai","kaus","exchange"],
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"dependencies": { "@modelcontextprotocol/sdk": "^1.0.0" }
|
|
11
|
+
}
|