Mistral Codestral
STDIOMCP server for code completion, bug fixing, and test generation using Mistral Codestral API.
MCP server for code completion, bug fixing, and test generation using Mistral Codestral API.
An MCP server implementation for the Mistral Codestral API, providing code completion, bug fixing, and test generation capabilities.
Clone this repository
Install dependencies:
npm install
Copy .env.example
to .env
and add your Mistral API key:
cp .env.example .env
Build the project:
npm run build
Start the server:
npm start
Add your Mistral API key to the .env
file:
MISTRAL_API_KEY=your_api_key_here
Process code for completion, bug fixing, or test generation:
Parameters:
code
(string, required): The code to processlanguage
(string, optional): Programming languagetask
(string, required): One of:
"complete"
: Code completion"fix"
: Bug fixing"test"
: Test generation"fim"
: Fill-in-the-Middle completionThe server supports two main Mistral models:
codestral-latest
: Default model for code-related taskscodestral-mamba-latest
: Alternative model with Mamba architectureFeatures include:
Run in development mode with auto-reloading:
npm run dev
Run tests:
npm test
The server implements comprehensive error handling:
The server provides access to code files through the file://code
resource URI, allowing integration with workspace files.
MIT