Highlights
- mcp 2.x support. The server now runs on the MCP Python SDK 2.x
MCPServerAPI and requiresmcp>=2.1.1,<3, lifting the<2cap from v0.6.1. Existing configuration, transports, and tool interfaces are unchanged. (#61, #68) - Configurable rate limiting. Search and fetch caps are now settable (
DDG_SEARCH_RPM,DDG_FETCH_RPM), with an optional per-host fetch cap (DDG_FETCH_HOST_RPM, off by default) and atoken_bucketstrategy alongside the default sliding window. HTTP 429 responses honorRetry-Afterand retry once. The sliding-window limiter is now serialized so concurrent calls cannot exceed the cap. Thanks @tonythethompson. (#66) - Fetch cache and parse modes.
fetch_contentkeeps the parsed page in an in-memory TTL/LRU cache (default 5 minutes, 64 entries) so paginating withstart_indexdownloads once. A newparse_modeparameter offerstext(default, unchanged),main(primary article only), andmarkdown(headings, lists, links, code). Thanks @tonythethompson. (#67) - Long URL shortening. Search results replace URLs longer than 120 characters (
DDG_REF_URL_THRESHOLD,0disables) with shortref://<id>tokens.fetch_contentaccepts a token directly, and a newexpand_linktool returns the full URL. (#43, #69)
Upgrade notes
pip install -U duckduckgo-mcp-serverpulls in mcp 2.x. If you pinmcpyourself, move to>=2.1.1,<3.- Output of
fetch_contentis unchanged in the defaulttextmode. The content trailer gainscache=hit|misswhile the cache is enabled. - All new settings have CLI flags:
--rate-limit-strategy,--search-rpm,--fetch-rpm,--fetch-host-rpm,--cache-ttl,--cache-max-entries,--parse-mode,--ref-url-threshold.
What's Changed
- feat(rate-limit): token bucket, per-host caps, and 429 retry by @tonythethompson in #66
- feat(fetch): cache paginated fetch_content and add parse_mode extractors by @tonythethompson in #67
- feat(deps): migrate to mcp 2.x (MCPServer API) by @nickclyde in #68
- feat: shorten long result URLs to ref:// tokens with expand_link tool by @nickclyde in #69
New Contributors
- @tonythethompson made their first contribution in #66
Full Changelog: v0.6.1...v0.7.0