Ollama MCP Database Assistant
Features
- Natural language interface to your PostgreSQL database
- Automatic SQL query generation
- Schema-aware responses
- Interactive chat interface
- Secure, read-only database access
Prerequisites
- Node.js 16 or higher
- A running PostgreSQL database
- Ollama installed and running locally
- The qwen2.5-coder:7b-instruct model pulled in Ollama
Setup
- Clone the repository:
- Install dependencies:
- Pull the required Ollama model:
- Create a
.env
file in the project root:
Usage
- Start the chat interface:
- Ask questions about your data in natural language:
- Type 'exit' to quit the application.
How It Works
- The application connects to your PostgreSQL database through the PostgreSQL MCP server
- It loads and caches your database schema
- When you ask a question:
Environment Variables
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
Security
- All database access is read-only
- SQL queries are restricted to SELECT statements
- Database credentials are kept secure in your .env file
Development
- TypeScript
- Model Context Protocol (MCP)
- Ollama
- PostgreSQL
Troubleshooting
Common Issues
- "Failed to connect to database"
- "Failed to connect to Ollama"
- "Error executing query"
License
Contributing
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
Ollama MCP Database Assistant
Features
- Natural language interface to your PostgreSQL database
- Automatic SQL query generation
- Schema-aware responses
- Interactive chat interface
- Secure, read-only database access
Prerequisites
- Node.js 16 or higher
- A running PostgreSQL database
- Ollama installed and running locally
- The qwen2.5-coder:7b-instruct model pulled in Ollama
Setup
- Clone the repository:
- Install dependencies:
- Pull the required Ollama model:
- Create a
.env
file in the project root:
Usage
- Start the chat interface:
- Ask questions about your data in natural language:
- Type 'exit' to quit the application.
How It Works
- The application connects to your PostgreSQL database through the PostgreSQL MCP server
- It loads and caches your database schema
- When you ask a question:
Environment Variables
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
Security
- All database access is read-only
- SQL queries are restricted to SELECT statements
- Database credentials are kept secure in your .env file
Development
- TypeScript
- Model Context Protocol (MCP)
- Ollama
- PostgreSQL
Troubleshooting
Common Issues
- "Failed to connect to database"
- "Failed to connect to Ollama"
- "Error executing query"
License
Contributing
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request