oxinion-finance-mcp
by oxinion
README.md
# Oxinion Finance MCP Server
A remote MCP server for Oxinion Finance, deployed on Cloudflare Workers.
**Production URL:** `https://mcp.oxinion.com/finance/mcp`
## Development
```bash
pnpm install
npm start
```
Server runs at `http://localhost:8787/finance/mcp`.
## Deploy
```bash
npx wrangler@latest deploy
```
Deploys to `finance.oxinion.com/mcp` (route configured in `wrangler.jsonc`).
## Connect Claude Code (Recommended)
Run below in your terminal to connect the MCP server to Claude Code:
```bash
claude mcp add --transport http oxinion-finance https://mcp.oxinion.com/finance/mcp
```
## Connect Claude Desktop
Go to **Settings → Developer → Edit Config** and add:
```json
{
"mcpServers": {
"oxinion-finance": {
"command": "npx",
"args": ["mcp-remote", "https://mcp.oxinion.com/finance/mcp"]
}
}
}
```
Restart Claude and the tools will appear.
## Local testing with MCP Inspector
Terminal 1:
```bash
npm start
```
Terminal 2:
```bash
npx @modelcontextprotocol/inspector@latest
```
Open the Inspector URL in your browser, set transport to **Streamable HTTP**, enter `http://localhost:8787/finance/mcp`, and connect.
## Adding Tools
Add tools inside the `init()` method in `src/index.ts`:
```ts
async init() {
this.server.registerTool("tool-name", {
description: "...",
inputSchema: z.object({ ... }),
}, async (input) => {
return { content: [{ type: "text", text: "..." }] };
});
}
```
## Telegram bot
**Webhook URL:** `https://mcp.oxinion.com/finance/telegram-webhook`
Send a ticker (`TSLA`, `$COST`) to the bot in Telegram and it replies with
price/RSI/trend/score/signal, straight from `src/stock-analysis.ts` (the
same lookup the `stock-analysis` MCP tool uses) — no long-running process,
no MCP client round-trip, just a Worker route.
This replaces the old standalone `oxinion-finance/telegram` bot, which used
Telegraf + long polling and had to stay running in a terminal. That folder
is now only useful for local testing against the MCP server as a client; it
is not part of the production path anymore.
### Local vars
`.dev.vars` already has `TELEGRAM_BOT_TOKEN` and `TELEGRAM_WEBHOOK_SECRET`
filled in for local testing (`npm start`, then POST a fake Update to
`http://localhost:8787/finance/telegram-webhook`).
### Deploy Telegram bot
```bash
npx wrangler@latest deploy
wrangler secret put TELEGRAM_BOT_TOKEN
wrangler secret put TELEGRAM_WEBHOOK_SECRET # optional but recommended
```
### Register the webhook with Telegram
Run once (or whenever the URL/secret changes):
```bash
curl "https://api.telegram.org/bot<TELEGRAM_BOT_TOKEN>/setWebhook" \
-d "url=https://mcp.oxinion.com/finance/telegram-webhook" \
-d "secret_token=<TELEGRAM_WEBHOOK_SECRET>"
```
Verify it's registered:
```bash
curl "https://api.telegram.org/bot<TELEGRAM_BOT_TOKEN>/getWebhookInfo"
```
Then message the bot in Telegram with a ticker to test end-to-end.
This server cannot be deployed