-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Mcp #1912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gary149
wants to merge
22
commits into
main
Choose a base branch
from
mcp
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,647
−139
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Introduces Model Context Protocol (MCP) tool support by adding new server modules (httpClient, registry, tools), a ToolUpdate Svelte component, and Tool type definitions. Updates chat message handling and message update logic to integrate tool updates, and adds the @modelcontextprotocol/sdk dependency.
Introduces debug and warning logs around MCP tool calls in generate.ts to improve traceability of tool invocation, completion, and errors. Minor formatting adjustments in ChatMessage.svelte for derived store usage.
Improves tool mapping in getOpenAiToolsForMcp by adding plain tool names and preventing duplicates. Updates MCP flow routing to select multimodal models when image input is detected, improving support for multimodal requests.
Refactors MCP tool listing and invocation for better type safety and normalization. Enhances OpenAI chat completion streaming with stricter typing, improved multimodal support, and more robust tool call aggregation. Cleans up type definitions and utility functions for message updates. Fixes minor bugs and improves code clarity throughout MCP and text generation modules.
Enhanced ToolUpdate.svelte to better format and display tool parameters, outputs, and error messages. Refactored httpClient.ts to robustly fallback from streamable to SSE transport, improving error handling and connection management for MCP tool calls.
Implements source citation extraction and annotation in generated answers, propagates source metadata through message updates, and displays sources with favicons and hostnames in the chat UI. Updates Markdown rendering to decorate citations and refines math inline parsing to avoid false positives. Improves handling of sources in server, client, and type definitions for consistent citation support.
Enhances citation mapping logic in text generation to ensure only valid indices are used and injects mapping instructions for sources. Refactors citation rendering in marked.ts to operate on HTML code blocks instead of markdown, improving inline citation placement. Updates ChatMessage.svelte to use parsed origin for favicons and hostname normalization. Fixes message content update logic in conversation page.
Enhanced citation mapping logic in text generation to prevent redundant system messages and ensure correct injection timing. Improved accessibility for source links in ChatMessage.svelte by adding title and aria-label attributes. Refined citation rendering in marked.ts for more accurate inline citation formatting.
Enhances citation mapping and normalization to avoid duplicate system messages and properly mask code segments. Refines URL extraction and normalization, improves link sanitization in markdown rendering, and updates citation rendering logic to use safe href attributes. Also fixes message content updates to preserve initial content during streaming.
Changed executeToolCalls to be an async generator yielding MessageUpdate objects instead of returning an array. Updated runMcpFlow to consume the generator and yield updates as they are produced, improving streaming and memory efficiency.
Changed executeToolCalls to yield structured ToolExecutionEvent objects, separating 'update' and 'complete' events. Updated runMcpFlow to handle the new event types and improved error handling and logging for missing execution summaries.
Updated the preprompt for title generation to provide clearer, stricter instructions and examples for generating concise, descriptive titles. Improved fallback handling by ensuring summary is always a string and clarified that no post-processing is performed.
Introduces support for converting bracketed citations (e.g., [1]) in markdown content into links when matching sources are provided. Updates ChatMessage to pass sources to MarkdownRenderer, and adds tests to verify correct linkification and fallback behavior.
…logical analysis prompt in routerExamples
Refactors citation tracking to use canonicalized URLs and robust URL extraction via linkify-it, preventing duplicate or spurious citations. Updates MarkdownRenderer to avoid adding citations inside code/pre tags. Adds a new url.ts utility for URL normalization and extraction. Updates routerExamples with a new Flappy Bird example. Adjusts MCP tool invocation and flow to use the new citation processing methods. Adds linkify-it and its types as dependencies.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.