diff --git a/.gitignore b/.gitignore
index 7ecb7109b8..a6beb0bc5c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -122,6 +122,9 @@ dist
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
+# Jetbrains IDEs
+.idea/
+
# yarn v2
.yarn/cache
.yarn/unplugged
diff --git a/README.md b/README.md
index ae90632c8c..eb7aedf42c 100644
--- a/README.md
+++ b/README.md
@@ -80,7 +80,7 @@ Official integrations are maintained by companies building production ready MCP
-
**[Apache Doris](https://github.com/apache/doris-mcp-server)** - MCP Server For [Apache Doris](https://doris.apache.org/), an MPP-based real-time data warehouse.
-
**[Apache IoTDB](https://github.com/apache/iotdb-mcp-server)** - MCP Server for [Apache IoTDB](https://github.com/apache/iotdb) database and its tools
- **[Apache Pinot](https://github.com/startreedata/mcp-pinot)** – MCP server for running real - time analytics queries on Apache Pinot, an open-source OLAP database built for high-throughput, low-latency powering real-time applications.
--
**[Apify](https://github.com/apify/actors-mcp-server)** - [Actors MCP Server](https://apify.com/apify/actors-mcp-server): Use 3,000+ pre-built cloud tools to extract data from websites, e-commerce, social media, search engines, maps, and more
+-
**[Apify](https://github.com/apify/apify-mcp-server)** - Use 6,000+ pre-built cloud tools to extract data from websites, e-commerce, social media, search engines, maps, and more
-
**[APIMatic MCP](https://github.com/apimatic/apimatic-validator-mcp)** - APIMatic MCP Server is used to validate OpenAPI specifications using [APIMatic](https://www.apimatic.io/). The server processes OpenAPI files and returns validation summaries by leveraging APIMatic's API.
-
**[Apollo MCP Server](https://github.com/apollographql/apollo-mcp-server/)** - Connect your GraphQL APIs to AI agents
-
**[Aqara MCP Server](https://github.com/aqara/aqara-mcp-server/)** - Control [Aqara](https://www.aqara.com/) smart home devices, query status, execute scenes, and much more using natural language.
@@ -188,7 +188,7 @@ Official integrations are maintained by companies building production ready MCP
-
**[Fibery](https://github.com/Fibery-inc/fibery-mcp-server)** - Perform queries and entity operations in your [Fibery](https://fibery.io) workspace.
-
**[Financial Datasets](https://github.com/financial-datasets/mcp-server)** - Stock market API made for AI agents
-
**[Firebase](https://github.com/firebase/firebase-tools/blob/master/src/mcp)** - Firebase's experimental [MCP Server](https://firebase.google.com/docs/cli/mcp-server) to power your AI Tools
--
**[Firecrawl](https://github.com/mendableai/firecrawl-mcp-server)** - Extract web data with [Firecrawl](https://firecrawl.dev)
+-
**[Firecrawl](https://github.com/firecrawl/firecrawl-mcp-server)** - Extract web data with [Firecrawl](https://firecrawl.dev)
-
**[Firefly](https://github.com/gofireflyio/firefly-mcp)** - Integrates, discovers, manages, and codifies cloud resources with [Firefly](https://firefly.ai).
-
**[Fireproof](https://github.com/fireproof-storage/mcp-database-server)** - Immutable ledger database with live synchronization
-
**[FIXParser](https://gitlab.com/logotype/fixparser/-/tree/main/packages/fixparser-plugin-mcp)** - A modern FIX Protocol engine for AI-powered trading agents
@@ -336,6 +336,7 @@ Official integrations are maintained by companies building production ready MCP
-
**[PayPal](https://mcp.paypal.com)** - PayPal's official MCP server.
-
**[Pearl](https://github.com/Pearl-com/pearl_mcp_server)** - Official MCP Server to interact with Pearl API. Connect your AI Agents with 12,000+ certified experts instantly.
-
**[Perplexity](https://github.com/ppl-ai/modelcontextprotocol)** - An MCP server that connects to Perplexity's Sonar API, enabling real-time web-wide research in conversational AI.
+-
**[PDFActionInspector](https://github.com/foxitsoftware/PDFActionInspector/tree/develop)** - A Model Context Protocol server for extracting and analyzing JavaScript Actions from PDF files. Provides comprehensive security analysis to detect malicious PDF behaviors, hidden scripts, and potential security threats through AI-assisted risk assessment.
-
**[PGA (Golf)](https://mcp.pga.com)** - PGA's official MCP Server for all things golf-related. Find a coach, play golf, improve your game, and more.
-
**[Pinecone](https://github.com/pinecone-io/pinecone-mcp)** - [Pinecone](https://docs.pinecone.io/guides/operations/mcp-server)'s developer MCP Server assist developers in searching documentation and managing data within their development environment.
-
**[Pinecone Assistant](https://github.com/pinecone-io/assistant-mcp)** - Retrieves context from your [Pinecone Assistant](https://docs.pinecone.io/guides/assistant/mcp-server) knowledge base.
@@ -358,6 +359,7 @@ Official integrations are maintained by companies building production ready MCP
-
**[Put.io](https://github.com/putdotio/putio-mcp-server)** - Interact with your Put.io account to download torrents.
-
**[Qdrant](https://github.com/qdrant/mcp-server-qdrant/)** - Implement semantic memory layer on top of the Qdrant vector search engine
-
**[Qorus](https://qoretechnologies.com/manual/qorus/current/qorus/sysarch.html#mcp_server)** - Connect to any application, system, or technology and automate your business processes without coding and with AI
+-
**[Qonto](https://github.com/qonto/qonto-mcp-server)** - Access and interact your Qonto account through LLMs using MCP.
-
**[QuantConnect](https://github.com/QuantConnect/mcp-server)** - Interact with your [QuantConnect](https://www.quantconnect.com/) account to update projects, write strategies, run backtest, and deploying strategies to production live-trading.
- **[Quickchat AI](https://github.com/incentivai/quickchat-ai-mcp)** - Launch your conversational [Quickchat AI](https://quickchat.ai) agent as an MCP to give AI apps real-time access to its Knowledge Base and conversational capabilities
-
**[Ragie](https://github.com/ragieai/ragie-mcp-server/)** - Retrieve context from your [Ragie](https://www.ragie.ai) (RAG) knowledge base connected to integrations like Google Drive, Notion, JIRA and more.
@@ -695,7 +697,6 @@ A growing set of community-developed and maintained servers demonstrates various
- **[FileSystem Server](https://github.com/Oncorporation/filesystem_server)** - Local MCP server for Visual Studio 2022 that provides code-workspace functionality by giving AI agents selective access to project folders and files
- **[finmap.org](https://github.com/finmap-org/mcp-server)** MCP server provides comprehensive historical data from the US, UK, Russian and Turkish stock exchanges. Access sectors, tickers, company profiles, market cap, volume, value, and trade counts, as well as treemap and histogram visualizations.
- **[Firebase](https://github.com/gannonh/firebase-mcp)** - Server to interact with Firebase services including Firebase Authentication, Firestore, and Firebase Storage.
-- **[FireCrawl](https://github.com/vrknetha/mcp-server-firecrawl)** - Advanced web scraping with JavaScript rendering, PDF support, and smart rate limiting
- **[Fish Audio](https://github.com/da-okazaki/mcp-fish-audio-server)** - Text-to-Speech integration with Fish Audio's API, supporting multiple voices, streaming, and real-time playback
- **[FitBit MCP Server](https://github.com/NitayRabi/fitbit-mcp)** - An MCP server that connects to FitBit API using a token obtained from OAuth flow.
- **[FlightRadar24](https://github.com/sunsetcoder/flightradar24-mcp-server)** - A Claude Desktop MCP server that helps you track flights in real-time using Flightradar24 data.
@@ -812,6 +813,7 @@ A growing set of community-developed and maintained servers demonstrates various
- **[kintone](https://github.com/macrat/mcp-server-kintone)** - Manage records and apps in [kintone](https://kintone.com) through LLM tools.
- **[Kokoro TTS](https://github.com/mberg/kokoro-tts-mcp)** - Use Kokoro text to speech to convert text to MP3s with optional autoupload to S3.
- **[Kong Konnect](https://github.com/Kong/mcp-konnect)** - A Model Context Protocol (MCP) server for interacting with Kong Konnect APIs, allowing AI assistants to query and analyze Kong Gateway configurations, traffic, and analytics.
+- **[Korea Stock Analyzer](https://github.com/Mrbaeksang/korea-stock-analyzer-mcp)** - Analyze Korean stocks (KOSPI/KOSDAQ) with 6 legendary investment strategies including Buffett, Lynch, Graham, Greenblatt, Fisher, and Templeton.
- **[Kubernetes](https://github.com/Flux159/mcp-server-kubernetes)** - Connect to Kubernetes cluster and manage pods, deployments, and services.
- **[Kubernetes and OpenShift](https://github.com/manusa/kubernetes-mcp-server)** - A powerful Kubernetes MCP server with additional support for OpenShift. Besides providing CRUD operations for any Kubernetes resource, this server provides specialized tools to interact with your cluster.
- **[KubeSphere](https://github.com/kubesphere/ks-mcp-server)** - The KubeSphere MCP Server is a Model Context Protocol(MCP) server that provides integration with KubeSphere APIs, enabling to get resources from KubeSphere. Divided into four tools modules: Workspace Management, Cluster Management, User and Roles, Extensions Center.
@@ -1014,6 +1016,7 @@ A growing set of community-developed and maintained servers demonstrates various
- **[PDMT](https://github.com/paiml/pdmt)** - Pragmatic Deterministic MCP Templating - High-performance deterministic templating library with comprehensive todo validation, quality enforcement, and 0.0 temperature generation for reproducible outputs.
- **[Peacock for VS Code](https://github.com/johnpapa/peacock-mcp)** - MCP Server for the Peacock extension for VS Code, coloring your world, one Code editor at a time. The main goal of the project is to show how an MCP server can be used to interact with APIs.
- **[persistproc](https://github.com/irskep/persistproc)** - MCP server + command line tool that allows agents to see & control long-running processes like web servers.
+- **[Pexels](https://github.com/garylab/pexels-mcp-server)** - A MCP server providing access to Pexels Free Image API, enabling seamless search, retrieval, and download of high-quality royalty-free images.
- **[Pharos](https://github.com/QuentinCody/pharos-mcp-server)** - Unofficial MCP server for the Pharos database by the National Center for Advancing Translational Sciences (NCATS), providing access to target, drug, and disease information for drug discovery research.
- **[Phone MCP](https://github.com/hao-cyber/phone-mcp)** - 📱 A powerful plugin that lets you control your Android phone. Enables AI agents to perform complex tasks like automatically playing music based on weather or making calls and sending texts.
- **[PIF](https://github.com/hungryrobot1/MCP-PIF)** - A Personal Intelligence Framework (PIF), providing tools for file operations, structured reasoning, and journal-based documentation to support continuity and evolving human-AI collaboration across sessions.
@@ -1055,6 +1058,7 @@ A growing set of community-developed and maintained servers demonstrates various
- **[RCSB PDB](https://github.com/QuentinCody/rcsb-pdb-mcp-server)** - Unofficial MCP server for the Research Collaboratory for Structural Bioinformatics Protein Data Bank (RCSB PDB), providing access to 3D protein structures, experimental data, and structural bioinformatics information.
- **[Reaper](https://github.com/dschuler36/reaper-mcp-server)** - Interact with your [Reaper](https://www.reaper.fm/) (Digital Audio Workstation) projects.
- **[Redbee](https://github.com/Tamsi/redbee-mcp)** - Redbee MCP server that provides support for interacting with Redbee API.
+- **[Redfish](https://github.com/nokia/mcp-redfish)** - Redfish MCP server that provides support for interacting with [DMTF Redfish API](https://www.dmtf.org/standards/redfish).
- **[Redis](https://github.com/GongRzhe/REDIS-MCP-Server)** - Redis database operations and caching microservice server with support for key-value operations, expiration management, and pattern-based key listing.
- **[Redis](https://github.com/prajwalnayak7/mcp-server-redis)** MCP server to interact with Redis Server, AWS Memory DB, etc for caching or other use-cases where in-memory and key-value based storage is appropriate
- **[RedNote MCP](https://github.com/ifuryst/rednote-mcp)** - MCP server for accessing RedNote(XiaoHongShu, xhs) content
@@ -1072,6 +1076,7 @@ A growing set of community-developed and maintained servers demonstrates various
- **[Salesforce MCP](https://github.com/smn2gnt/MCP-Salesforce)** - Interact with Salesforce Data and Metadata
- **[Salesforce MCP (AiondaDotCom)](https://github.com/AiondaDotCom/mcp-salesforce)** - Universal Salesforce integration with OAuth authentication, smart learning system, comprehensive backup capabilities, and full CRUD operations for any Salesforce org including custom objects and fields.
- **[Salesforce MCP Server](https://github.com/tsmztech/mcp-server-salesforce)** - Comprehensive Salesforce integration with tools for querying records, executing Apex, managing fields/objects, and handling debug logs
+- **[Scanova MCP Server](https://github.com/trycon/scanova-mcp)** - MCP server for creating and managing QR codes using the [Scanova](https://scanova.io) API. Provides tools for generating, managing, and downloading QR codes.
- **[SchemaCrawler](https://github.com/schemacrawler/SchemaCrawler-MCP-Server-Usage)** - Connect to any relational database, and be able to get valid SQL, and ask questions like what does a certain column prefix mean.
- **[SchemaFlow](https://github.com/CryptoRadi/schemaflow-mcp-server)** - Real-time PostgreSQL & Supabase database schema access for AI-IDEs via Model Context Protocol. Provides live database context through secure SSE connections with three powerful tools: get_schema, analyze_database, and check_schema_alignment. [SchemaFlow](https://schemaflow.dev)
- **[Scholarly](https://github.com/adityak74/mcp-scholarly)** - An MCP server to search for scholarly and academic articles.
@@ -1083,7 +1088,7 @@ A growing set of community-developed and maintained servers demonstrates various
- **[SearXNG Public](https://github.com/pwilkin/mcp-searxng-public)** - A Model Context Protocol Server for retrieving data from public [SearXNG](https://docs.searxng.org) instances, with fallback support
- **[SEC EDGAR](https://github.com/stefanoamorelli/sec-edgar-mcp)** - (by Stefano Amorelli) A community Model Context Protocol Server to access financial filings and data through the U.S. Securities and Exchange Commission ([SEC](https://www.sec.gov/)) `Electronic Data Gathering, Analysis, and Retrieval` ([EDGAR](https://www.sec.gov/submit-filings/about-edgar)) database
- **[SEO MCP](https://github.com/cnych/seo-mcp)** - A free SEO tool MCP (Model Control Protocol) service based on Ahrefs data. Includes features such as backlinks, keyword ideas, and more. by [claudemcp](https://www.claudemcp.com/servers/seo-mcp).
-- **[Serper](https://github.com/garymengcom/serper-mcp-server)** - An MCP server that performs Google searches using [Serper](https://serper.dev).
+- **[Serper](https://github.com/garylab/serper-mcp-server)** - An MCP server that performs Google searches using [Serper](https://serper.dev).
- **[ServiceNow](https://github.com/osomai/servicenow-mcp)** - An MCP server to interact with a ServiceNow instance
- **[ShaderToy](https://github.com/wilsonchenghy/ShaderToy-MCP)** - This MCP server lets LLMs to interact with the ShaderToy API, allowing LLMs to learn from compute shaders examples and enabling them to create complex GLSL shaders that they are previously not capable of.
- **[ShareSeer](https://github.com/shareseer/shareseer-mcp-server)** - MCP to Access SEC filings, financials & insider trading data in real time using [ShareSeer](https://shareseer.com)
@@ -1099,11 +1104,13 @@ A growing set of community-developed and maintained servers demonstrates various
- **[Slidespeak](https://github.com/SlideSpeak/slidespeak-mcp)** - Create PowerPoint presentations using the [Slidespeak](https://slidespeak.com/) API.
- **[Smartlead](https://github.com/jean-technologies/smartlead-mcp-server-local)** - MCP to connect to Smartlead. Additional, tooling, functionality, and connection to workflow automation platforms also available.
- **[Snowflake](https://github.com/isaacwasserman/mcp-snowflake-server)** - This MCP server enables LLMs to interact with Snowflake databases, allowing for secure and controlled data operations.
+- **[Snowflake Cortex MCP Server](https://github.com/thisisbhanuj/Snowflake-Cortex-MCP-Server)** -This Snowflake MCP server provides tooling for Snowflake Cortex AI features, bringing these capabilities to the MCP ecosystem. When connected to an MCP Client (e.g. Claude for Desktop, fast-agent, Agentic Orchestration Framework), users can leverage these Cortex AI features.
- **[SoccerDataAPI](https://github.com/yeonupark/mcp-soccer-data)** - This MCP server provides real-time football match data based on the SoccerDataAPI.
- **[Solana Agent Kit](https://github.com/sendaifun/solana-agent-kit/tree/main/examples/agent-kit-mcp-server)** - This MCP server enables LLMs to interact with the Solana blockchain with help of Solana Agent Kit by SendAI, allowing for 40+ protocol actions and growing
- **[Solr MCP](https://github.com/mjochum64/mcp-solr-search)** - This MCP server offers a basic functionality to perform a search on Solr servers.
- **[Solver](https://github.com/szeider/mcp-solver)** - Solves constraint satisfaction and optimization problems .
- **[Solvitor](https://github.com/Adeptus-Innovatio/solvitor-mcp)** – Solvitor MCP server provides tools to access reverse engineering tools that help developers extract IDL files from closed - source Solana smart contracts and decompile them.
+- **[Sourcerer](https://github.com/st3v3nmw/sourcerer-mcp)** - MCP for semantic code search & navigation that reduces token waste.
- **[Specbridge](https://github.com/TBosak/specbridge)** - Easily turn your OpenAPI specs into MCP Tools.
- **[Splunk](https://github.com/jkosik/mcp-server-splunk)** - Golang MCP server for Splunk (lists saved searches, alerts, indexes, macros...). Supports SSE and STDIO.
- **[Spotify](https://github.com/varunneal/spotify-mcp)** - This MCP allows an LLM to play and use Spotify.
@@ -1147,6 +1154,7 @@ A growing set of community-developed and maintained servers demonstrates various
- **[Thales CDSP CRDP MCP Server](https://github.com/sanyambassi/thales-cdsp-crdp-mcp-server)** - A Model Context Protocol (MCP) server that allows interacting with the CipherTrust RestFul Data Protection (CRDP) data protection service.
- **[Thales CipherTrust Manager MCP Server](https://github.com/sanyambassi/ciphertrust-manager-mcp-server)** - MCP server for Thales CipherTrust Manager integration, enabling secure key management and cryptographic operations.
- **[thegraph-mcp](https://github.com/kukapay/thegraph-mcp)** - An MCP server that powers AI agents with indexed blockchain data from The Graph.
+- **[TheHive MCP Server](https://github.com/redwaysecurity/the-hive-mcp-server)** - An MCP server for [TheHive](https://strangebee.com/thehive/) Security Incident Response Platform.
- **[Things3 MCP](https://github.com/urbanogardun/things3-mcp)** - Things3 task management integration for macOS with comprehensive TODO, project, and tag management.
- **[Think MCP](https://github.com/Rai220/think-mcp)** - Enhances any agent's reasoning capabilities by integrating the think-tools, as described in [Anthropic's article](https://www.anthropic.com/engineering/claude-think-tool).
- **[Think Node MCP](https://github.com/abhinav-mangla/think-tool-mcp)** - Enhances any agent's reasoning capabilities by integrating the think-tools, as described in [Anthropic's article](https://www.anthropic.com/engineering/claude-think-tool). (Works with Node)
diff --git a/package-lock.json b/package-lock.json
index 56ba065ca9..fe72fc4328 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -5818,7 +5818,7 @@
"version": "0.6.2",
"license": "MIT",
"dependencies": {
- "@modelcontextprotocol/sdk": "^1.17.4",
+ "@modelcontextprotocol/sdk": "^1.17.5",
"express": "^4.21.1",
"zod": "^3.23.8",
"zod-to-json-schema": "^3.23.5"
@@ -5833,9 +5833,9 @@
}
},
"src/everything/node_modules/@modelcontextprotocol/sdk": {
- "version": "1.17.4",
- "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.17.4.tgz",
- "integrity": "sha512-zq24hfuAmmlNZvik0FLI58uE5sriN0WWsQzIlYnzSuKDAHFqJtBFrl/LfB1NLgJT5Y7dEBzaX4yAKqOPrcetaw==",
+ "version": "1.17.5",
+ "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.17.5.tgz",
+ "integrity": "sha512-QakrKIGniGuRVfWBdMsDea/dx1PNE739QJ7gCM41s9q+qaCYTHCdsIBXQVVXry3mfWAiaM9kT22Hyz53Uw8mfg==",
"license": "MIT",
"dependencies": {
"ajv": "^6.12.6",
diff --git a/src/everything/everything.ts b/src/everything/everything.ts
index c313b6eaaa..c1a99172ee 100644
--- a/src/everything/everything.ts
+++ b/src/everything/everything.ts
@@ -14,12 +14,11 @@ import {
ReadResourceRequestSchema,
Resource,
RootsListChangedNotificationSchema,
- SetLevelRequestSchema,
SubscribeRequestSchema,
Tool,
ToolSchema,
UnsubscribeRequestSchema,
- type Root,
+ type Root
} from "@modelcontextprotocol/sdk/types.js";
import { z } from "zod";
import { zodToJsonSchema } from "zod-to-json-schema";
@@ -174,7 +173,6 @@ export const createServer = () => {
let subsUpdateInterval: NodeJS.Timeout | undefined;
let stdErrUpdateInterval: NodeJS.Timeout | undefined;
- let logLevel: LoggingLevel = "debug";
let logsUpdateInterval: NodeJS.Timeout | undefined;
// Store client capabilities
let clientCapabilities: ClientCapabilities | undefined;
@@ -182,50 +180,43 @@ export const createServer = () => {
// Roots state management
let currentRoots: Root[] = [];
let clientSupportsRoots = false;
- const messages = [
- { level: "debug", data: "Debug-level message" },
- { level: "info", data: "Info-level message" },
- { level: "notice", data: "Notice-level message" },
- { level: "warning", data: "Warning-level message" },
- { level: "error", data: "Error-level message" },
- { level: "critical", data: "Critical-level message" },
- { level: "alert", data: "Alert level-message" },
- { level: "emergency", data: "Emergency-level message" },
- ];
-
- const isMessageIgnored = (level: LoggingLevel): boolean => {
- const currentLevel = messages.findIndex((msg) => logLevel === msg.level);
- const messageLevel = messages.findIndex((msg) => level === msg.level);
- return messageLevel < currentLevel;
- };
-
- // Function to start notification intervals when a client connects
- const startNotificationIntervals = () => {
- if (!subsUpdateInterval) {
- subsUpdateInterval = setInterval(() => {
- for (const uri of subscriptions) {
- server.notification({
- method: "notifications/resources/updated",
- params: { uri },
- });
- }
- }, 10000);
- }
+ let sessionId: string | undefined;
+
+ // Function to start notification intervals when a client connects
+ const startNotificationIntervals = (sid?: string|undefined) => {
+ sessionId = sid;
+ if (!subsUpdateInterval) {
+ subsUpdateInterval = setInterval(() => {
+ for (const uri of subscriptions) {
+ server.notification({
+ method: "notifications/resources/updated",
+ params: { uri },
+ });
+ }
+ }, 10000);
+ }
- if (!logsUpdateInterval) {
- logsUpdateInterval = setInterval(() => {
- let message = {
- method: "notifications/message",
- params: messages[Math.floor(Math.random() * messages.length)],
- };
- if (!isMessageIgnored(message.params.level as LoggingLevel))
- server.notification(message);
- }, 20000);
+ console.log(sessionId)
+ const maybeAppendSessionId = sessionId ? ` - SessionId ${sessionId}`: "";
+ const messages: { level: LoggingLevel; data: string }[] = [
+ { level: "debug", data: `Debug-level message${maybeAppendSessionId}` },
+ { level: "info", data: `Info-level message${maybeAppendSessionId}` },
+ { level: "notice", data: `Notice-level message${maybeAppendSessionId}` },
+ { level: "warning", data: `Warning-level message${maybeAppendSessionId}` },
+ { level: "error", data: `Error-level message${maybeAppendSessionId}` },
+ { level: "critical", data: `Critical-level message${maybeAppendSessionId}` },
+ { level: "alert", data: `Alert level-message${maybeAppendSessionId}` },
+ { level: "emergency", data: `Emergency-level message${maybeAppendSessionId}` },
+ ];
+
+ if (!logsUpdateInterval) {
+ console.error("Starting logs update interval");
+ logsUpdateInterval = setInterval(async () => {
+ await server.sendLoggingMessage( messages[Math.floor(Math.random() * messages.length)], sessionId);
+ }, 15000);
}
};
-
-
// Helper method to request sampling from client
const requestSampling = async (
context: string,
@@ -918,23 +909,6 @@ export const createServer = () => {
throw new Error(`Unknown reference type`);
});
- server.setRequestHandler(SetLevelRequestSchema, async (request) => {
- const { level } = request.params;
- logLevel = level;
-
- // Demonstrate different log levels
- await server.notification({
- method: "notifications/message",
- params: {
- level: "debug",
- logger: "test-server",
- data: `Logging level set to: ${logLevel}`,
- },
- });
-
- return {};
- });
-
// Roots protocol handlers
server.setNotificationHandler(RootsListChangedNotificationSchema, async () => {
try {
@@ -944,24 +918,18 @@ export const createServer = () => {
currentRoots = response.roots;
// Log the roots update for demonstration
- await server.notification({
- method: "notifications/message",
- params: {
+ await server.sendLoggingMessage({
level: "info",
logger: "everything-server",
data: `Roots updated: ${currentRoots.length} root(s) received from client`,
- },
- });
+ }, sessionId);
}
} catch (error) {
- await server.notification({
- method: "notifications/message",
- params: {
+ await server.sendLoggingMessage({
level: "error",
logger: "everything-server",
data: `Failed to request roots from client: ${error instanceof Error ? error.message : String(error)}`,
- },
- });
+ }, sessionId);
}
});
@@ -976,43 +944,31 @@ export const createServer = () => {
if (response && 'roots' in response) {
currentRoots = response.roots;
- await server.notification({
- method: "notifications/message",
- params: {
+ await server.sendLoggingMessage({
level: "info",
logger: "everything-server",
data: `Initial roots received: ${currentRoots.length} root(s) from client`,
- },
- });
+ }, sessionId);
} else {
- await server.notification({
- method: "notifications/message",
- params: {
+ await server.sendLoggingMessage({
level: "warning",
logger: "everything-server",
data: "Client returned no roots set",
- },
- });
+ }, sessionId);
}
} catch (error) {
- await server.notification({
- method: "notifications/message",
- params: {
+ await server.sendLoggingMessage({
level: "error",
logger: "everything-server",
data: `Failed to request initial roots from client: ${error instanceof Error ? error.message : String(error)}`,
- },
- });
+ }, sessionId);
}
} else {
- await server.notification({
- method: "notifications/message",
- params: {
+ await server.sendLoggingMessage({
level: "info",
logger: "everything-server",
data: "Client does not support MCP roots protocol",
- },
- });
+ }, sessionId);
}
};
diff --git a/src/everything/package.json b/src/everything/package.json
index 0cff945cb8..8e417a28a4 100644
--- a/src/everything/package.json
+++ b/src/everything/package.json
@@ -22,7 +22,7 @@
"start:streamableHttp": "node dist/streamableHttp.js"
},
"dependencies": {
- "@modelcontextprotocol/sdk": "^1.17.4",
+ "@modelcontextprotocol/sdk": "^1.17.5",
"express": "^4.21.1",
"zod": "^3.23.8",
"zod-to-json-schema": "^3.23.5"
diff --git a/src/everything/sse.ts b/src/everything/sse.ts
index f414e02f2f..f201341948 100644
--- a/src/everything/sse.ts
+++ b/src/everything/sse.ts
@@ -26,7 +26,7 @@ app.get("/sse", async (req, res) => {
console.error("Client Connected: ", transport.sessionId);
// Start notification intervals after client connects
- startNotificationIntervals();
+ startNotificationIntervals(transport.sessionId);
// Handle close of connection
server.onclose = async () => {
diff --git a/src/everything/stdio.ts b/src/everything/stdio.ts
index a98fbc5371..5e01fd7fe9 100644
--- a/src/everything/stdio.ts
+++ b/src/everything/stdio.ts
@@ -2,21 +2,58 @@
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { createServer } from "./everything.js";
+import {
+ LoggingLevel,
+ LoggingLevelSchema,
+ LoggingMessageNotification,
+ SetLevelRequestSchema
+} from "@modelcontextprotocol/sdk/types.js";
console.error('Starting default (STDIO) server...');
async function main() {
- const transport = new StdioServerTransport();
- const {server, cleanup} = createServer();
+ const transport = new StdioServerTransport();
+ const {server, cleanup, startNotificationIntervals } = createServer();
- await server.connect(transport);
+ // Currently, for STDIO servers, automatic log-level support is not available, as levels are tracked by sessionId.
+ // The listener will be set, so if the STDIO server advertises support for logging, and the client sends a setLevel
+ // request, it will be handled and thus not throw a "Method not found" error. However, the STDIO server will need to
+ // implement its own listener and level handling for now. This will be remediated in a future SDK version.
- // Cleanup on exit
- process.on("SIGINT", async () => {
- await cleanup();
- await server.close();
- process.exit(0);
- });
+ let logLevel: LoggingLevel = "debug";
+ server.setRequestHandler(SetLevelRequestSchema, async (request) => {
+ const { level } = request.params;
+ logLevel = level;
+ return {};
+ });
+
+ server.sendLoggingMessage = async (params: LoggingMessageNotification["params"], _: string|undefined): Promise => {
+ const LOG_LEVEL_SEVERITY = new Map(
+ LoggingLevelSchema.options.map((level, index) => [level, index])
+ );
+
+ const isMessageIgnored = (level: LoggingLevel): boolean => {
+ const currentLevel = logLevel;
+ return (currentLevel)
+ ? LOG_LEVEL_SEVERITY.get(level)! < LOG_LEVEL_SEVERITY.get(currentLevel)!
+ : false;
+ };
+
+ if (!isMessageIgnored(params.level)) {
+ return server.notification({method: "notifications/message", params})
+ }
+
+ }
+
+ await server.connect(transport);
+ startNotificationIntervals();
+
+ // Cleanup on exit
+ process.on("SIGINT", async () => {
+ await cleanup();
+ await server.close();
+ process.exit(0);
+ });
}
main().catch((error) => {
diff --git a/src/everything/streamableHttp.ts b/src/everything/streamableHttp.ts
index f748fd2ade..c4fed73803 100644
--- a/src/everything/streamableHttp.ts
+++ b/src/everything/streamableHttp.ts
@@ -22,7 +22,7 @@ app.post('/mcp', async (req: Request, res: Response) => {
transport = transports.get(sessionId)!;
} else if (!sessionId) {
- const { server, cleanup } = createServer();
+ const { server, cleanup, startNotificationIntervals } = createServer();
// New initialization request
const eventStore = new InMemoryEventStore();
@@ -53,7 +53,11 @@ app.post('/mcp', async (req: Request, res: Response) => {
await server.connect(transport);
await transport.handleRequest(req, res);
- return; // Already handled
+
+ // Wait until initialize is complete and transport will have a sessionId
+ startNotificationIntervals(transport.sessionId);
+
+ return; // Already handled
} else {
// Invalid request - no session ID or not initialization request
res.status(400).json({