Nytimes 文章搜尋 Mcp 伺服器
概覽
什麼是 NYT?
NYT(紐約時報)庫是一個由用戶 angheljf 在 GitHub 上托管的公共項目。它作為一個平台,供開發者和愛好者協作進行與紐約時報相關的項目,可能包括數據分析、網頁抓取或與報紙文章和特徵相關的內容管理。
NYT 的特點
- 公共訪問:該庫是公開可訪問的,允許任何人查看、貢獻和分叉該項目。
- 協作:用戶可以在項目的各個方面進行協作,包括編碼、文檔和測試。
- 開源:該項目根據 MIT 許可證進行授權,促進開源開發和共享。
- 社區參與:用戶可以為該庫點讚以表達感謝並關注更新,也可以分叉以創建自己的版本。
如何參與 NYT
- 訪問庫:前往 NYT GitHub 頁面 探索該項目。
- 點讚庫:如果你覺得該項目有趣,請點讚以接收更新並表達支持。
- 分叉項目:創建你自己的庫副本,以實驗更改或開發新功能。
- 貢獻:如果你有建議或改進,考慮提交拉取請求以進行更改。
- 與社區互動:參加討論、報告問題或提問,以與其他貢獻者建立聯繫。
常見問題
我可以用 NYT 庫做什麼?
你可以將 NYT 庫用於各種目的,包括數據分析、網頁抓取或構建利用紐約時報數據的應用程序。
我需要是開發者才能貢獻嗎?
雖然編程技能是有益的,但任何人都可以通過提供反饋、報告問題或建議功能來貢獻。
我應該遵循特定的編碼風格嗎?
是的,建議遵循庫文檔中提供的編碼風格指南,以保持一致性。
我如何報告問題?
你可以通過導航到庫頁面的“問題”選項卡,並提交一個詳細描述的新問題來報告問題。
我可以將 NYT 數據用於商業目的嗎?
你應該檢查你使用的數據的許可條款和條件,因為某些數據可能對商業使用有限制。
詳細
NYTimes Article Search MCP Server
This is a TypeScript-based MCP server that allows searching for New York Times articles from the last 30 days based on a keyword. It demonstrates core MCP concepts by providing:
- Tools for searching articles
- Integration with the New York Times API
<a href="https://glama.ai/mcp/servers/ylg4ai4vin"><img width="380" height="200" src="https://glama.ai/mcp/servers/ylg4ai4vin/badge" alt="NYTimes Article Search Server MCP server" /></a>
Features
Tools
search_articles
- Search NYTimes articles from the last 30 days based on a keyword- Takes
keyword
as a required parameter - Returns a list of articles with title, abstract, URL, published date, and author
- Takes
Development
Install dependencies:
npm install
Build the server:
npm run build
For development with auto-rebuild:
npm run watch
Debugging
Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:
npm run inspector
The Inspector will provide a URL to access debugging tools in your browser.
Installation
Installing via Smithery
To install NYTimes Article Search for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install nyt --client claude
Manual Installation
To use with Claude Desktop, add the server config:
On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"nyt": {
"command": "node",
"args": ["path/to/your/build/index.js"],
"env": {
"NYTIMES_API_KEY": "your_api_key_here"
}
}
}
}
Environment Variables
Create a .env
file in the root of your project and add your New York Times API key:
NYTIMES_API_KEY=your_api_key_here
Running the Server
After building the project, you can run the server with:
node build/index.js
The server will start and listen for MCP requests over stdio.
License
This project is licensed under the MIT License.
伺服器配置
{
"mcpServers": {
"nyt": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--angheljf--nyt--nyt",
"node ./build/index.js"
],
"env": {
"NYTIMES_API_KEY": "nytimes-api-key"
}
}
}
}