test-newsapi-mcp

Provides authenticated or pay-per-use MCP access to the test-newsapi-mcp API via a secure HTTP endpoint and tools.
  • python

0

GitHub Stars

python

Language

7 months ago

First Indexed

3 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs

You can access the test-newsapi-mcp API through a dedicated MCP server that supports authenticated Bearer token access or pay-per-use via an HTTP 402 protocol. This setup enables AI agents and LLMs to interact with the API endpoints in a standard, secure way while offering flexible deployment options, including Docker and local development.

How to use

To use the server, connect your MCP client to the MCP endpoint and choose between two operation modes. In authenticated mode you provide your own API key to access the test-newsapi-mcp API through the server; in paid mode you pay per request and the server validates the payment before forwarding the call. You can call tools like example_tool and get_api_info to interact with the API and retrieve information.

How to install

Prerequisites: you need Docker or Python with the uv tool installed on your system.

# Prerequisites: Docker (recommended) or Python/uv

Option A: Docker (recommended) installs and runs the MCP server with a single script.

# 1) Set your API key for the server (used in payment mode if enabled)
export TEST_NEWSAPI_MCP_API_KEY="your-api-key-here"

# 2) Run the server with Docker
./run_local_docker.sh

Option B: Docker Compose provides more configuration control.

# 1) Create a .env file with your configuration (example values shown)
# TEST_NEWSAPI_MCP_API_KEY=your-api-key-here
# SERVER_ADDRESS=0x1234567890123456789012345678901234567890
# MCP_OPERATOR_PRIVATE_KEY=0x1234567890abcdef...
# MCP_OPERATOR_ADDRESS=0x9876543210fedcba...
PORT=8000

# 2) Start the server with Docker Compose
docker-compose up

Option C: Manual installation using Python and uv (for development or custom environments).

# 1) Install the package in editable mode
uv pip install -e .

# 2) Start the server (set your API key for paid mode if needed)
TEST_NEWSAPI_MCP_API_KEY="your-api-key-here" uv run python -m server

Additional notes on configuration and security

The server supports two operation modes. In Authenticated Access mode you use a client-provided API key to pass through to the test-newsapi-mcp API. In Payment mode you rely on the server’s own API key and validate payments via the D402-based workflow.

Environment variables shown in the configuration include keys for API access, payment setup, and optional testing modes. Ensure these values are kept secure and never checked into version control.

Environment and payment notes

Payment verification uses the traia_iatp.d402 integration. The default price is configurable and can be adjusted for your deployment.

If you enable the HTTP 402 flow, clients must provide a valid payment proof in the request header. The server will validate the payment and then forward the request to the internal API key for actual data access.

Troubleshooting

If the server does not start, check container or process logs for errors related to environment variables or port binding.

Authentication errors usually indicate an invalid API key or missing Authorization header in authenticated mode.

For tool-related errors, inspect server logs to identify which tool failed and review its argument structure.

Available tools

example_tool

Placeholder tool (to be implemented) that exposes a placeholder API surface for demonstration and testing in MCP clients.

get_api_info

Tool that returns information about the API service and current authentication status.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational