Skip to content

feat: 🚀 MCP automatic tool discovery + dynamic models + AI function c… - #17

Merged
murdore merged 1 commit into
releasefrom
feat/mcp-auto-discovery-dynamic-models
Jun 20, 2025
Merged

murdore merged 1 commit into
releasefrom
feat/mcp-auto-discovery-dynamic-models

Conversation

@murdore

@murdore murdore commented Jun 20, 2025

Copy link
Copy Markdown
Contributor

🚀 MCP Automatic Tool Discovery + Dynamic Models + AI Function Calling

Overview

This PR introduces a revolutionary enhancement to NeuroLink, transforming it from a multi-provider AI SDK into a comprehensive AI development platform with automatic tool discovery and execution capabilities.

🎯 What's New

1. MCP Automatic Tool Discovery

  • Automatically discovers and integrates 82+ tools from connected MCP servers
  • Zero configuration required - just install MCP servers and NeuroLink finds them
  • Supports filesystem operations, GitHub integration, and custom tools
  • Real-time tool discovery with <1ms performance per tool

2. AI Function Calling

  • Seamless integration with Vercel AI SDK for multi-turn conversations
  • Tools are automatically executed and results integrated into AI responses
  • Works with Google AI Studio, OpenAI, and other providers
  • Example: "What time is it?" → AI calls tool → Returns actual current time

3. Dynamic Model Configuration

  • Configure custom models via config/models.json
  • Add new AI models without code changes
  • Support for any OpenAI-compatible API
  • Hot-reload capability for development

4. Enhanced CLI Commands

# Agent-based generation with automatic tool use
neurolink agent-generate "What files are in my project?"

# MCP server management
neurolink mcp list        # List connected servers
neurolink mcp test        # Test server connectivity
neurolink mcp tools       # Discover available tools

Copilot AI review requested due to automatic review settings June 20, 2025 17:23

This comment was marked as outdated.

@murdore
murdore force-pushed the feat/mcp-auto-discovery-dynamic-models branch from db9c676 to 8397dd7 Compare June 20, 2025 17:33
…alling

BREAKING CHANGE: Enhanced provider architecture with MCP integration

- ✨ MCP automatic tool discovery - detects 82+ tools from connected servers
- 🎯 AI function calling - seamless tool execution with Vercel AI SDK
- 🔧 Dynamic model configuration via config/models.json
- 🤖 Agent-based generation with automatic tool selection
- 📡 Real-time MCP server management and monitoring

- Added MCPEnhancedProvider for automatic tool integration
- Implemented function calling for Google AI, OpenAI providers
- Created unified tool registry for MCP and built-in tools
- Enhanced CLI with `agent-generate` and MCP management commands
- Added comprehensive examples and documentation

- Automatic .mcp-config.json discovery across platforms
- Session-based context management for tool execution
- Graceful fallback when MCP servers unavailable
- Performance optimized tool discovery (<1ms per tool)

- Added 5 new comprehensive guides (MCP, troubleshooting, dynamic models)
- Created practical examples for all integration patterns
- Updated API reference with new capabilities
- Enhanced memory bank with implementation details

Resolves: Enhanced AI capabilities with real-world tool integration
@murdore
murdore force-pushed the feat/mcp-auto-discovery-dynamic-models branch from 8397dd7 to 28d0278 Compare June 20, 2025 18:25
@murdore
murdore requested a review from Copilot June 20, 2025 18:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces major enhancements to NeuroLink by integrating automatic MCP tool discovery, dynamic model configuration, and AI function calling. Key changes include removing unused test-output JSON artifacts, updating provider factory methods to be asynchronous with proper dynamic model resolution, and a new MCP-aware provider implementation that wraps multiple AI providers with MCP tool support.

Reviewed Changes

Copilot reviewed 57 out of 75 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test-output.json Removed obsolete sample output data for cleaner codebase.
src/test.ts Changed direct factory usage to use await for asynchronous provider creation.
src/lib/providers/openAI.ts Added a new getModel() method to expose the underlying language model for function calling.
src/lib/providers/mcp-provider.ts Introduced a new MCP-aware provider with session-based MCP tool initialization.
src/lib/providers/googleAIStudio.ts Updated getModel() access to public and added tools-related parameters in text generation.
src/lib/providers/agent-enhanced-provider.ts Provided an enhanced agent provider supporting CLI-based agent generation with tools.
src/lib/neurolink.ts Updated MCP initialization and fallback logic to enable real MCP tool integration.
src/lib/mcp/* Multiple files added/updated to support unified MCP tool registry, auto-discovery, logging, and session management.
src/cli/* Added new CLI commands (e.g., agent-generate) and enhanced options for tool enablement.
memory-bank/* Updated documentation reflecting new MCP discovery, function calling integration, and dynamic models.
Comments suppressed due to low confidence (1)

src/lib/core/factory.ts:215

  • [nitpick] There is commented-out MCP wrapping code in the provider factory. If this is temporary for debugging, consider documenting the reason or removing it once the issue is resolved.
          // const { createMCPAwareProviderV3 } = await import("../providers/function-calling-provider.js");

Comment thread src/lib/neurolink.ts
Comment on lines +5 to 7
* Uses real MCP infrastructure for // Initialize MCP with enhanced error handling
await this.initializeMCP();tool discovery and execution.
*/

Copilot AI Jun 20, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment in neurolink.ts combines descriptive text with stray inline code comments. Consider cleaning it up to clearly separate documentation from development notes.

Suggested change
* Uses real MCP infrastructure for // Initialize MCP with enhanced error handling
await this.initializeMCP();tool discovery and execution.
*/
* Uses real MCP infrastructure for tool discovery and execution.
*/
// Initialize MCP with enhanced error handling
await this.initializeMCP();

Copilot uses AI. Check for mistakes.
Comment thread src/lib/core/factory.ts
? resolveError.message
: String(resolveError),
},
);

Copilot AI Jun 20, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Ensure that using null as the fallback for a default dynamic model is intentional and consistent with other provider implementations.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants