Skip to main content
Glama
kerrybackapps

Rice Stock Data Portal MCP Server

README.md
# Rice Stock Data Portal - MCP Server

A Model Context Protocol (MCP) server that provides natural language access to Rice Business Stock Market Data Portal through Claude Desktop.

## Quick Start

### For Users

1. **Install the MCP server:**
   ```bash
   npm install -g @kerryback/data-portal-mcp
   ```

2. **Get your access token** from your Rice Data Portal instance

3. **Configure Claude Desktop** by adding to your config file:
   ```json
   {
     "mcpServers": {
       "rice-stock-data": {
         "command": "npx",
         "args": ["@kerryback/data-portal-mcp"],
         "env": {
           "KOYEB_APP_URL": "https://your-app.koyeb.app",
           "MCP_ACCESS_TOKEN": "your_access_token_here"
         }
       }
     }
   }
   ```

4. **Start asking questions** in Claude Desktop:
   - "Show me Apple's financial ratios"
   - "Find undervalued healthcare stocks"
   - "What are the top technology companies by market cap?"

### For Developers

This repository contains the MCP server implementation for the Rice Stock Data Portal. The server acts as a bridge between Claude Desktop and your deployed Flask application.

## Features

- 🔒 **Secure Token Storage** - Access tokens stored in Claude Desktop configuration
- 💬 **Natural Language Queries** - Ask questions in plain English
- 📊 **Real-time Data** - Direct access to your MotherDuck financial database
- 🎓 **University Integration** - Designed for academic use with email verification
- âš¡ **Fast Responses** - Leverages existing OpenAI chat integration

## Architecture

```
Claude Desktop → MCP Server → Flask App → MotherDuck Database
```

The MCP server forwards natural language queries to your Flask app's `/chat` endpoint, which uses OpenAI to understand the query and generate appropriate SQL.

## Repository Structure

- `src/index.ts` - Main TypeScript MCP server implementation
- `package.json` - NPM package configuration
- `Procfile` - Koyeb deployment configuration
- `FINAL_MCP_README.md` - Complete user documentation
- `DEPLOYMENT.md` - Deployment guide

## Development

```bash
# Install dependencies
npm install

# Build TypeScript
npm run build

# Run locally
npm start

# Test with environment variables
KOYEB_APP_URL=http://localhost:5000 \
MCP_ACCESS_TOKEN=your_token \
npm start
```

## Deployment

This MCP server can be deployed to Koyeb for remote access:

1. Connect your GitHub repository to Koyeb
2. Set environment variables in Koyeb dashboard
3. Deploy using the provided `Procfile`

See `DEPLOYMENT.md` for complete instructions.

## Documentation

- **`FINAL_MCP_README.md`** - Complete user guide
- **`DEPLOYMENT.md`** - Deployment instructions
- **`claude_desktop_config.json`** - Configuration example

## Support

- **Issues**: [GitHub Issues](https://github.com/kerrybackapps/data-portal-mcp/issues)
- **Main Portal**: [Rice Stock Data Portal](https://github.com/kerrybackapps/data_app)

## License

MIT License - See LICENSE file for details