X (formerly Twitter) released MCP servers for its API and developer documentation. This walkthrough shows how to build a Spring AI MCP client using Spring Boot 4.1 and Spring AI 2.0 that connects to both X MCP servers. The docs server requires no authentication and lets an LLM query up-to-date X API documentation. The API server requires a bearer token passed via an MCP client customizer, enabling the agent to search posts, look up users, and retrieve trends. The tutorial covers project setup, YAML configuration for streamable HTTP MCP connections, creating a ChatClient bean with tool callback providers, and two REST controllers demonstrating each server.
•24m watch time
258 Impressions