news-mcp-server

laplus-x/news-mcp-server

3.2

If you are the rightful owner of news-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A Go-based Model Context Protocol (MCP) server for fetching the latest news articles using the GDELT API.

Tools
1
Resources
0
Prompts
0

news-mcp-server

A Go-based Model Context Protocol (MCP) server for fetching the latest news articles using the GDELT API.

Table of Contents

Overview

news-mcp-server is a lightweight MCP server written in Go that exposes a tool for retrieving news articles based on a query string. It leverages the GDELT API to provide up-to-date news data and is designed for easy integration with MCP clients.

Features

  • MCP-compliant HTTP server
  • Fetches news articles from GDELT based on query parameters
  • Singleton pattern for efficient resource usage
  • Configurable via environment variables
  • Docker-ready for containerized deployment

Getting Started

Prerequisites

  • Go 1.23+
  • Docker (optional, for containerization)

Installation

Clone the repository and install dependencies:

git clone https://github.com/laplus-x/news-mcp-server.git
cd news-mcp-server
go mod tidy

Configuration

Copy .env.example to .env and set your desired host and port:

HOST=localhost
PORT=8080

Usage

Start the MCP server:

go run main.go

The server will listen for MCP requests at http://<HOST>:<PORT>/mcp.

API

MCP Tool: getNews

Fetches the latest news articles based on a query string.

Endpoint: /mcp
Method: POST (MCP protocol)

Arguments:

  • query (string): The search keyword.

Response:

Returns a JSON object containing the first matching news article.

Example response:

{
	"url": "...",
	"title": "...",
	"seendate": "...",
	"domain": "...",
	"language": "...",
	"sourcecountry": "..."
}

License

MIT