A MCP Server for JSer.info
- Introduction - Model Context Protocol
- modelcontextprotocol/typescript-sdk: The official Typescript SDK for Model Context Protocol servers and clients
Install with npm:
npx @jser/mcp
VSCodeでMCP拡張機能がインストールされている場合、以下の手順で@jser/mcpを利用できます:
-
ターミナルで@jser/mcpを起動する
npx @jser/mcp
-
VSCodeのコマンドパレットを開き(
Cmd+Shift+P
またはCtrl+Shift+P
)、「MCP: Add Server...」を実行 -
サーバーURLに
http://localhost:3000/mcp
を入力して接続 -
接続後、以下のツールが利用可能になります:
jser_search_items
: タイトル、説明、URL、タグでアイテムを検索(複数キーワードでOR検索可能)jser_search_posts
: タイトル、説明、URL、タグで投稿を検索jser_product_name
: URLから製品名を取得jser_week
: 番号からJSer週を取得jser_weeks
: 全てのJSer週を取得jser_weeks_between
: 二つの日付の間のJSer週を取得jser_week_with_item_url
: アイテムを含むJSer週を取得jser_item_with_url
: URLからJSerアイテムを取得
データの取得は@jser/data-fetcher
を利用する
- データ取得の感覚は最後に実行してから1分経過したら再取得する
- つまり1分間はキャッシュのデータを利用する
検索にはDataSetを利用する
Item: 紹介するサイトのこと
1 Item = 1 サイト
すべてのデータのoriginとなるものです
サイトごとにタイトル、URL、登録した日付、タグなどが含まれています
API: https://jser.info/source-data/items.json
Post: JSer.infoに投稿される記事のこと
1 Post = 1 記事
それぞれの記事のタイトル、URL、タグ、日付などが含まれます
@jser/statを使うことでItemとPostを元に指定したサイトが紹介された記事を検索できます
API: https://jser.info/posts.json
Post Item: JSer.infoに投稿された記事中のItem(サイト)のこと
1 Post Item = 1 サイト
基本的にはItemと同じだが、Post ItemはPost(記事)におけるカテゴリ(ヘッドラインなど)が含まれます
カテゴリの種類は @jser/post-parser を参照してください
Itemを元に投稿時に編集している場合などもあるため、ItemとPost Itemは必ずしも一致するわけではありません
制限: カテゴリ区別が付けられたのは2014-08-03からであるため、それ以前のデータは含まれない
Postにはすべての記事は含まれるがPost Itemのデータは含まれていない
API: https://jser.info/public/data/post-details.json
プロダクト名の検索にはJSer.info Product Name APIを利用する
$ curl "https://jser-product-name.deno.dev/?url=https://deno.com/blog/v1.19"
{"name":"Deno","url":"https://deno.com","releaseNoteProbability":0.7619047619047619,"releaseNoteVersion":"v1.19"}
$ curl "https://jser-product-name.deno.dev/?url=https://example.com"
null # status code is 400
データ抽出のロジックは @jser/stat を利用する。
### findItemsBetween(beginDate, endDate): JSerItem[]
return JSerItems between two dates
### getJSerWeeks(): JSerWeek[]
return all JSerWeeks
### findJSerWeeksBetween(beginDate, endDate): JSerWeek[]
return JSerWeeks between two dates
### findJSerWeek(number): JSerWeek
number start with 1.
return JSerWeek at the number.
### findWeekWithItem(itemObject): JSerWeek
return JSerWeek contain the itemObject.
### findItemWithURL(URL): JSerItem
return JSerItem match the `URL`.
- Tool Name:
jser_search_items
- Title: Search items by title, description, url, and tags
- Description: Search items by title, description, url, and tags.スペースで区切られた複数のキーワードをOR検索します。
- Parameters:
query
: Search querylimit
: Number of results to return (default: 10)offset
: Offset for pagination (default: 0)sort
: Sort order (default: "relevance")order
: Sort order (default: "desc")
- Tool Name:
jser_search_posts
- Title: Search posts by title, description, url, and tags
- Description: Search posts by title, description, url, and tags
- Parameters:
query
: Search querylimit
: Number of results to return (default: 10)offset
: Offset for pagination (default: 0)sort
: Sort order (default: "relevance")order
: Sort order (default: "desc")
- Tool Name:
jser_post_items
- Title: Search post items by title, description, url, and tags
- Description: Search post items by title, description, url, and tags
- Parameters:
query
: Search querylimit
: Number of results to return (default: 10)offset
: Offset for pagination (default: 0)sort
: Sort order (default: "relevance")order
: Sort order (default: "desc")
- Tool Name:
jser_product_name
- Title: Get product name by URL
- Description: Get product name by URL
- Parameters:
url
: URL of the product
- Returns:
name
: Name of the producturl
: URL of the productreleaseNoteProbability
: Probability of the product being a release notereleaseNoteVersion
: Version of the productreleaseNoteURL
: URL of the release note
- Tool Name:
jser_week
- Title: Get JSer week by number
- Description: Get JSer week by number
- Parameters:
number
: Number of the JSer week
- Returns:
number
: Number of the JSer weekstartDate
: Start date of the JSer weekendDate
: End date of the JSer weekitems
: List of items in the JSer weekposts
: List of posts in the JSer week
- Tool Name:
jser_weeks
- Title: Get all JSer weeks
- Description: Get all JSer weeks
- Returns:
number
: Number of the JSer weekstartDate
: Start date of the JSer weekendDate
: End date of the JSer weekitems
: List of items in the JSer weekposts
: List of posts in the JSer week
- Tool Name:
jser_weeks_between
- Title: Get JSer weeks between two dates
- Description: Get JSer weeks between two dates
- Parameters:
beginDate
: Start date of the rangeendDate
: End date of the range
- Returns:
number
: Number of the JSer weekstartDate
: Start date of the JSer weekendDate
: End date of the JSer weekitems
: List of items in the JSer weekposts
: List of posts in the JSer weekitemsCount
: Number of items in the JSer weekpostsCount
: Number of posts in the JSer week
- Tool Name:
jser_week_with_item_url
- Title: Get JSer week with item
- Description: Get JSer week with item
- Parameters:
item_url
: URL of the item
- Returns:
number
: Number of the JSer weekstartDate
: Start date of the JSer weekendDate
: End date of the JSer weekitems
: List of items in the JSer weekposts
: List of posts in the JSer week
- Tool Name:
jser_item_with_url
- Title: Get JSer item with URL
- Description: Get JSer item with URL
- Parameters:
url
: URL of the item
- Returns:
title
: Title of the itemurl
: URL of the itemdescription
: Description of the itemtags
: Tags of the itemdate
: Date of the itemrelatedLinks
: Related links of the item
See Releases page.
Install devDependencies and Run pnpm test
:
pnpm test
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
MIT © azu