MCP is an open-source standard for connecting AI applications to external systems. Instead of calling fixed API endpoints, the language model dynamically discovers and uses tools at runtime, allowing your client to adapt without hardcoding endpoints.
We use MCP for its flexibility and ease of use with AI applications allowing us to focus more on designing tools that answer real-world battery market questions.
Our MCP server provides a set of battery data tools to support market analysis. To get started, generate an API key from the user settings page and use it to authenticate your MCP client.
You can connect to our MCP server over HTTP using an MCP-compatible client, such as the Vercel AI SDK or the OpenAI Agents SDK.
Below is a simple example demonstrating how to initialize an MCP client using the Vercel AI SDK(TypeScript).
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { createMCPClient } from '@ai-sdk/mcp';
import { streamText } from "ai";
// Initialize your model provider
const provider = createOpenAICompatible({
name: 'providerName',
apiKey: 'PROVIDER_API_KEY',
baseURL: 'https://api.provider.com/v1',
});
// Create an MCP client using HTTP transport
const mcpClient = await createMCPClient({
transport: {
type: 'http',
url: 'https://newenergyterminal.org/mcp/v1',
headers: { Authorization: 'Bearer MY_API_KEY' }, // API key from user settings
redirect: 'error',
},
});
// Retrieve available MCP tools
const tools = await mcpClient.tools();
// Use the tools with a model
const result = await streamText({
model: provider('model-id'),
tools,
prompt: 'Anything new in battery?',
onFinish: async () => {
await mcpClient.close(); // Close the MCP client after use to release resources
},
});You'll find a list of tools here: