MCP搜索
一种模型上下文协议服务器,为JSer.info的JavaScript资源数据库提供搜索和检索功能,通过各种专业工具访问项目、帖子、产品信息和时间线数据。
服务介绍
@jser/mcp
An MCP Server for JSer.info
- Introduction - Model Context Protocol
- modelcontextprotocol/typescript-sdk: The official Typescript SDK for Model Context Protocol servers and clients
Usage
Usage in VSCode
In VSCode, you can use JSer.info MCP in one of the following ways:
Using a Remote Server (Recommended)
You can add a remote server using either of the following methods:
Method 1: Add via Command Line
bash
code --add-mcp {"name":"jser-info-mcp","url":"https://mcp.jser.info/mcp"}
Method 2: Add to settings.json
Add the following configuration to your VSCode settings.json:
json
"mcp": {
"servers": {
"jser-info-mcp": {
"url": "https://mcp.jser.info/mcp"
}
}
}
This will automatically make JSer.info MCP available.
Using a Local Server
-
Start
@jser/mcpin the terminal
bash
npx @jser/mcp -
Open the VSCode command palette (
Cmd+Shift+PorCtrl+Shift+P) and runMCP: Add Server... -
Enter
http://localhost:14561/mcpas the server URL to connect
Available Features
After connecting, the following tools will be available:
jser_search_items: Search items by title, description, URL, and tags (supports OR search with multiple keywords)jser_search_posts: Search posts by title, description, URL, and tagsjser_product_name: Get product name from URLjser_week: Get JSer week by numberjser_weeks: Get all JSer weeksjser_weeks_between: Get JSer weeks between two datesjser_week_with_item_url: Get JSer week containing an itemjser_item_with_item_url: Get JSer item by URL
Available Tools
JSer.info MCP provides the following tools.
jser_search_items
Searches items by title, description, URL, and tags. Multiple keywords separated by spaces are searched with OR logic.
Parameters:
query: Search query (1-100 characters). Multiple keywords separated by spaces are searched with OR logic.limit: Maximum number of results to return (1-100, default: 10)offset: Offset of the results (0 or greater, default: 0)order: Sort orderdesc: Newest first (default)asc: Oldest first
Return Value:
- Array of items
title: Title of the itemurl: URL of the itemcontent: Description of the itemtags: Array of tagsdate: Registration date and timerelatedLinks: Array of related links
jser_search_posts
Searches posts by title, description, URL, and tags.
Parameters:
query: Search query (1-100 characters)limit: Maximum number of results to return (1-100, default: 10)offset: Offset of the results (0 or greater, default: 0)sort: Sort criteriarelevance: By relevance (default)date: By date
order: Sort orderdesc: Newest first / highest relevance (default)asc: Oldest first / lowest relevance
Return Value:
- Array of posts
title: Title of the posturl: URL of the postcontent: Content of the posttags: Array of tagsdate: Posting date and time
jser_product_name
Gets the product name from a URL.
Parameters:
url: URL of the product (required)
Return Value:
- Product information object
name: Product nameurl: URL of the productreleaseNoteProbability: Probability that it is a release notereleaseNoteVersion: Version information of the release note (if applicable)-releaseNoteURL: URL of the release note (if applicable)
jser_week
Retrieves a JSer week by its number.
Parameters:
number: The number of the JSer week (required)
Return Value:
- A JSer week object
number: The number of the JSer weekstartDate: Start dateendDate: End dateitems: List of items for that weekposts: List of posts for that week
jser_weeks
Retrieves all JSer weeks.
Return Value:
- An array of JSer week objects
number: The number of the JSer weekstartDate: Start dateendDate: End dateitems: List of items for that weekposts: List of posts for that week
jser_weeks_between
Retrieves JSer weeks within a specified period.
Parameters:
beginDate: Start date of the period (required)endDate: End date of the period (required)
Return Value:
- An array of JSer week objects
number: The number of the JSer weekstartDate: Start dateendDate: End dateitems: List of items for that weekposts: List of posts for that weekitemsCount: Number of itemspostsCount: Number of posts
jser_week_with_item_url
Retrieves a JSer week containing an item with the specified URL.
Parameters:
item_url: URL of the item (required)
Return Value:
- A JSer week object
number: The number of the JSer weekstartDate: Start dateendDate: End dateitems: List of items for that weekposts: List of posts for that week
jser_item_with_item_url
Retrieves an item with the specified URL.
Parameters:
url: URL of the item (required)
Return Value:
- An item object
title: Titleurl: URLdescription: Descriptiontags: Array of tagsdate: DaterelatedLinks: Array of related links
Source
Data retrieval is done using @jser/data-fetcher.
- Data is fetched again if one minute has passed since the last fetch.
- In other words, cached data is used for up to one minute.
For searching, DataSet is utilized.
Item: Refers to the site being introduced
1 Item = 1 Site
This is the origin of all data.
Each site includes a title, URL, registration date, and tags.
API: https://jser.info/source-data/items.json
Post: Refers to articles posted on JSer.info
1 Post = 1 Article
Each article includes a title, URL, tags, and date.
Using @jser/stat, you can search for articles that introduce a specific site based on Items and Posts.
API: https://jser.info/posts.json
Post Item: Refers to the Item (site) within an article posted on JSer.info
1 Post Item = 1 Site
It is essentially the same as an Item, but a Post Item also includes the category (e.g., headline) in the context of the Post (article).
For the types of categories, refer to @jser/post-parser.
Since some Post Items may be edited at the time of posting, they do not necessarily match the original Items.
Limitation: Category distinctions are available only from 2014-08-03 onwards, so earlier data does not include this information.
All articles are included in Posts, but Post Item data is not included.
API: https://jser.info/public/data/post-details.json
For product name searches, the JSer.info Product Name API is used.
bash
$ 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 400The logic for data extraction utilizes @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.
Changelog
See Releases page.
Running tests
Install devDependencies and Run pnpm test:
pnpm test
Contributing
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
Author
License
MIT © azu