Skip to content

Commit

Permalink
Add environment configuration and update README instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
nielthiart committed Dec 19, 2024
1 parent 46991a4 commit 0ddd1a3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MISTRAL_API_KEY="YOUR_MISTRAL_API_KEY"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules/
build/
*.log
.env*
.env
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ This repository is part of a blog post by Speakeasy: [Building a Mistral MCP Ser

To interact with the Mistral AI platform, you'll need an API key. You can get one by signing up at [mistral.ai](https://mistral.ai/).

Set your API key as an environment variable. Create a copy of `.env.example` and rename it to `.env`.

```bash
cp .env.example .env
open .env
```

Then update the `.env` file with your API key:

```bash
MISTRAL_API_KEY="YOUR_MISTRAL_API_KEY"
```

## Tools

This server provides two tools:
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node

import path from "path";
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import {
Expand All @@ -18,7 +18,7 @@ import {
} from "./schema.js";

import dotenv from "dotenv";
dotenv.config();
dotenv.config({path: path.join(import.meta.dirname, "..", ".env")});

const server = new Server(
{
Expand Down

0 comments on commit 0ddd1a3

Please sign in to comment.