CJ Affiliate Link Resolver and MCP
<!-- Logo -->
<h1 align="center">CJ Affiliate link resolver and MCP</h1>
<!-- Tagline -->
<h4 align="center">Resolve tracking links for specific merchant pages and your CJ promotional property.</h4>
<!-- Badges -->
<div align="center">
<img alt="Tests" src="https://github.com/Daniela-and-Will-Travel/cj-affiliate-mcp/actions/workflows/test.yml/badge.svg">
<img alt="Docs" src="https://github.com/Daniela-and-Will-Travel/cj-affiliate-mcp/actions/workflows/docs.yml/badge.svg">
<img alt="Docs Lint" src="https://github.com/Daniela-and-Will-Travel/cj-affiliate-mcp/actions/workflows/docs-lint.yml/badge.svg">
<img alt="GitHub Issues" src="https://img.shields.io/github/issues/Daniela-and-Will-Travel/cj-affiliate-mcp">
<img alt="GitHub Pull Requests" src="https://img.shields.io/github/issues-pr/Daniela-and-Will-Travel/cj-affiliate-mcp">
<a href="LICENSE.md"><img alt="MIT License" src="https://img.shields.io/github/license/Daniela-and-Will-Travel/cj-affiliate-mcp"></a>
</div>
<!-- Nav -->
<p align="center">
<a href="#key-features">Key Features</a> •
<a href="#installation">Installation</a> •
<a href="#usage">Usage</a> •
<a href="#documentation">Documentation</a> •
<a href="#support">Support</a> •
<a href="#contributing">Contributing</a> •
<a href="#license">License</a>
</p>
This independent publisher tool uses the CJ Affiliate Link Search API to find
links for a specific destination. Run it locally from the command line or
through a Model Context Protocol (MCP) client.
## Key Features
- Check advertiser relationships, promotional properties, tracking hosts, and merchant domains.
- Keep a CJ-issued tracking link intact when it already points to the exact page.
- Construct a same-host deep link when the offer permits it.
- Return `portal_required` with a reason when the search cannot confirm an eligible link.
## Installation
From a checkout, install with Python 3.11 or later in a virtual environment.
```bash
python -m pip install .
```
## Usage
Configure your CJ token, then substitute your destination and CJ IDs.
[Credential setup](docs/configuration.md)
```bash
cj-affiliate "https://merchant.example/a-page" --website-id 12345 --link-id 67890
```
A `resolved` result includes the tracking URL as JSON.
## Documentation
Start with the [documentation home](docs/index.md), or jump to
[getting started](docs/getting-started.md), [configuration](docs/configuration.md),
the [API reference](docs/api.md), or [troubleshooting](docs/troubleshooting.md).
## Support
File a [GitHub issue](https://github.com/Daniela-and-Will-Travel/cj-affiliate-mcp/issues/new/choose).
## Contributing
See the [project setup](docs/development.md), the shared
[contributing guide](https://github.com/willtheorangeguy/.github/blob/main/CONTRIBUTING.md),
and the [code of conduct](https://github.com/willtheorangeguy/.github/blob/main/CODE_OF_CONDUCT.md).
## License
This project is licensed under the [MIT License](LICENSE.md).
TDQS
Scored across 1 tool
There is only one tool, so there is no possibility of misselection between competing tools. Its purpose (resolving an exact HTTPS merchant page to a joined CJ affiliate link) is clearly stated and non-overlapping by construction.
The single name resolve_cj_link follows a clean verb_noun_snake_case convention that would scale predictably to siblings like lookup_advertiser or list_links. Consistency cannot be fully demonstrated with only one tool, so it is not a perfect 5.
One tool is thin even for a narrowly scoped resolver; the description implies supporting lookups (Website ID, Link ID, Advertiser ID discovery) that have no tools. The single tool does earn its place for the core resolve operation, but the surface feels bare.
The core resolution operation is covered, but the tool expects the agent to already know a Website ID or optionally a Link/Advertiser ID, with no tools to discover or validate those identifiers. There is also no way to handle the portal_required outcome beyond reporting failure, leaving an agent at a dead end when configuration is missing.