kotlin-news
MCP server from nishantpardamwar/kotlin-news-mcp-server
claude mcp add --transport stdio nishantpardamwar-kotlin-news-mcp-server docker run -i nishantpardamwar/kotlin-news-mcp-server \ --env NEWS_API_KEY="your_api_key_here"
How to use
This MCP server provides two tools for working with news data via the MCP protocol. The first tool, get-top-headline, retrieves the current top headlines by category such as business, entertainment, general, health, science, sports, or technology. The second tool, search-news-query, enables searching news articles using a query string with optional filters for date ranges and sort order. The server is implemented in Kotlin using Ktor and relies on the NewsAPI service, so you must provide a NewsAPI key in the NEWS_API_KEY environment variable for authentication. Once the server is running, you can invoke the MCP tools through your MCP client (like Cursor) to fetch headlines or perform targeted searches against NewsAPI data, receiving structured responses that align with the MCP data model.
How to install
Prerequisites:
- Java Development Kit (JDK) 11 or newer
- Gradle build system
- Access to NewsAPI.org and a valid API key
Installation and setup steps:
-
Clone the repository: git clone https://github.com/nishantpardamwar/kotlin-news-mcp-server.git cd kotlin-news-mcp-server
-
Obtain a NewsAPI key:
- Register at https://newsapi.org/register and get your API key.
- Set the environment variable NEWS_API_KEY to your key before running the server.
-
Build the project (local development): ./gradlew build
-
Run the server (local development): ./gradlew run
The server will typically start on http://localhost:3001
-
(Optional) Run via Docker:
- Ensure Docker is installed and running.
- Build an image or use a prebuilt image if available for this MCP server.
- Example (pull the image and run): docker pull nishantpardamwar/kotlin-news-mcp-server docker run -i -e NEWS_API_KEY=your_api_key_here -p 3001:3001 nishantpardamwar/kotlin-news-mcp-server
-
Verify the server is running:
- Access http://localhost:3001 to confirm the MCP endpoint is available.
Note: If you customize the environment (for example, change the port), ensure your MCP client points to the correct URL and port.
Additional notes
Environment variables:
- NEWS_API_KEY: Your NewsAPI key is required for fetching headlines and search results. Ensure this is set in your runtime environment.
Common issues:
- If the server fails to start due to port conflicts, stop the other service using the same port or configure the server to listen on a different port.
- If NewsAPI requests fail with authentication errors, double-check the NEWS_API_KEY value and ensure it is exported to the environment where the server runs.
- When running in Docker, remember to propagate the environment variable into the container (e.g., -e NEWS_API_KEY) and map the correct port.
Configuration options:
- The MCP endpoints expose two tools: get-top-headline and search-news-query. You can adjust client configurations to call these tools with the required inputs (category, query, fromDate, toDate, sortBy).
Troubleshooting tips:
- Check server logs for any Kotlin exceptions during startup or request handling.
- Verify network access to NewsAPI from the runtime environment.
- Ensure Gradle and JDK versions are compatible with the Kotlin codebase.
Related MCP Servers
burp-ai-agent
Burp Suite extension that adds built-in MCP tooling, AI-assisted analysis, privacy controls, passive and active scanning and more
FantasyPremierLeague
Fantasy Premier League Kotlin/Compose Multiplatform sample
mcp
MCP Server for Burp
paiml -agent-toolkit
Pragmatic AI Labs MCP Agent Toolkit - An MCP Server designed to make code with agents more deterministic
mcp-kotlin-sdk
Kotlin implementation of the Model Context Protocol (MCP)
k8s-ai
AI-Powered Kubernetes Management System: A platform combining natural language processing with Kubernetes management. Users can perform real-time diagnostics, resource monitoring, and smart log analysis. It simplifies Kubernetes management through conversational AI, providing a modern alternative