How to Use the BattleMetrics MCP in LangChain
Build ReAct agents in LangChain that query BattleMetrics stats, audit player sessions, and trace ban histories automatically.
Works with every AI agent you already use
…and any MCP-compatible client
Connect BattleMetrics MCP to LangChain
Create your Vinkius account to connect BattleMetrics to LangChain and route execution through our secure gateway. The platform manages server hosting, runtime updates, and security layers. Configuration requires no manual server provisioning.
Chain BattleMetrics MCP Server Queries
Your LangChain agent needs to investigate a suspicious player. It starts by calling `list_players` with a username to grab the exact BattleMetrics identifier. The agent evaluates the output, extracts the ID, and immediately feeds it into `get_player` to pull their linked Steam and EOS accounts. That output then flows directly into `get_player_sessions`. The reasoning pipeline checks the timestamps against server logs to verify exactly when the user joined. You get full observability in LangSmith, showing exactly which tools fired and how long the API took to respond.
Analyze Population Trends
Pulling raw server metrics is just the first step. You can build a chain that triggers `search_servers` to find top-ranked servers matching specific game criteria. The agent grabs the returned server IDs and maps them to the `get_server_player_count_history` tool. Passing ISO 8601 timestamps lets the model fetch historical data across peak hours. Your agent processes those arrays to output a final summary of population drops or spikes over the weekend. Every step executes sequentially without manual intervention.
Automate Organization Ban Audits
Managing moderation across multiple servers gets messy fast. Hook up the MCP Server's `list_bans` tool to your LangGraph pipeline to pull recent enforcement actions. The agent iterates through the paginated results, identifying organization-wide scopes versus server-level restrictions. When it finds a vague entry, the chain triggers `get_ban` to fetch the specific administrator ID and the exact reason logged. You can wire this data into a Slack alert node, creating a fully automated daily report of who caught a ban and why.
Set up BattleMetrics MCP in LangChain
Prerequisites
- Python 3.10+ installed
-
langchain-mcp-adapters+langgraphpackages - Active Vinkius subscription with a valid endpoint token
- 1
Install dependencies
Run
pip install langchain-mcp-adapters langgraph langchain-openai. The MCP adapters package converts MCP tools into native LangChainBaseToolobjects. - 2
Connect via HTTP transport
Use
MultiServerMCPClientwith"transport": "http"pointing to your Vinkius endpoint. Replace[YOUR_TOKEN_HERE]with your token from cloud.vinkius.com. - 3
Create a ReAct agent
Pass the discovered tools to
create_react_agent()from LangGraph. The agent automatically routes BattleMetrics tool calls through the MCP protocol. - 4
Run with any LLM
Swap
ChatOpenAIforChatAnthropic,ChatGoogleGenerativeAI, or any LangChain-compatible model. The MCP tools work identically across all providers.
from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI
async with MultiServerMCPClient({
"battlemetrics-mcp": {
"transport": "http",
"url": "https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp",
}
}) as client:
tools = client.get_tools()
agent = create_react_agent(
ChatOpenAI(model="gpt-4o"),
tools,
)
result = await agent.ainvoke({
"messages": "List recent BattleMetrics transactions"
})
print(result["messages"][-1].content) Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by BattleMetrics. All third-party trademarks, logos, and brand names are the property of their respective owners. Their use on this website is strictly for informational purposes to identify service compatibility and interoperability.
Why Choose Vinkius
Vinkius connects your tools to AI with real-time monitoring and automatic cost savings — all from one dashboard.
Real-time monitoring
Live
visibility into every interaction
Connect your favorite tools to your AI and see exactly what's happening — every request, every response, in real time.
Built-in savings
60%
lower AI costs
Vinkius compresses data between your apps and your AI automatically. Lower bills every month — no configuration required.
Single dashboard
One
place for every integration
Every tool your AI connects to, managed from a single screen. One account, complete control.
Common questions about BattleMetrics MCP in LangChain
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
Start using the BattleMetrics MCP today
We host it, we monitor it, we maintain it. You just paste one token.