Skip to content

Latest commit

 

History

History
57 lines (38 loc) · 1.81 KB

File metadata and controls

57 lines (38 loc) · 1.81 KB

MCP Tools

Integrating with MCP Tools.

Brave

The application consumes the Brave Search API.

Create an account

Visit api.search.brave.com and sign up for a new account. Then, in the Brave Search API console, navigate to Subscriptions and choose a subscription plan. You can choose the "Free AI" plan to get started.

Configure API Key

In the Brave Search API console, navigate to API Keys and generate a new API key. Copy and securely store your API key on your machine as an environment variable. The application will use it to access the Brave Search API.

export BRAVE_API_KEY=<YOUR-API-KEY>

Ollama

The application consumes models from an Ollama inference server. You can either run Ollama locally on your laptop, or rely on the Testcontainers support in Spring Boot to spin up an Ollama service automatically. If you choose the first option, make sure you have Ollama installed and running on your laptop. Either way, Spring AI will take care of pulling the needed Ollama models when the application starts, if they are not available yet on your machine.

Running the application

If you're using the native Ollama application, run the application as follows.

./gradlew bootRun

If you want to rely on the native Testcontainers support in Spring Boot to spin up an Ollama service at startup time, run the application as follows.

./gradlew bootTestRun

Calling the application

Note

These examples use the httpie CLI to send HTTP requests.

Call the application that will use an MCP Server to retrieve the context to answer your question.

http :8080/chat/mcp question=="Does Spring AI supports a Modular RAG architecture? Please provide some references."