Skip to content

MCP Servers

Learn how to use Model Context Protocol (MCP) modules in VJSP to achieve external tool integration, database connections, and extend the development environment.

Model Context Protocol (MCP) servers enable VJSP to connect to external tools, systems, and databases by running MCP servers.

These servers support the following functions:

  • Implement external integration: Connect to external tools and systems

  • Create extensible interfaces: Support custom function extensions

  • Support complex interactions: Deep integration with the development environment

  • Support partner contributions: Accept third-party proprietary function modules

How to Configure Model Context Protocol (MCP) in VJSP

Using and customizing MCP configuration

As AI systems continue to evolve, they remain limited by training data and cannot access real-time information or call specialized tools. The Model Context Protocol (MCP) solves this problem by enabling AI models to connect to external data sources, tools, and environments. This mechanism facilitates seamless information sharing and capability exchange between AI systems and the broader digital world. This standard, introduced by Anthropic, unifies the interaction logic for prompts, context, and tool calls, and is core to building truly practical AI experiences - experiences that can be flexibly configured with custom tools.

How MCP Works in VJSP

Currently, custom tools can be configured through the Model Context Protocol standard to achieve unified management of prompts, context, and tool usage.

MCP servers can be added to the central configuration via the mcpServers field. You can browse available MCP servers here.

ⓘ MCP is only supported in Agent mode.

Quick Start: Configure Your First MCP Server

Here's a quick example of configuring a new MCP server and applying it to the configuration file:

  1. Create a folder named .vjsp/mcpServers in your workspace root directory

  2. Add a file named playwright-mcp.yaml to this folder

  3. Write the following content and save

yaml
name: Playwright mcpServer
version: 0.0.1
schema: v1
mcpServers:
  - name: Browser Search
    command: npx
    args:
      - "@playwright/mcp@latest"

Now, test your MCP server by entering the following command:

plaintext
Open the browser and visit Baidu News.

How to Configure Document Search via MCP

You can configure MCP servers to search documents directly from the configuration. This is particularly useful for obtaining configuration and function-related help.

The VJSP documentation MCP server allows you to directly search and retrieve relevant information from VJSP documentation during agent conversations.

Configuration Steps

Configuring VJSP

  1. Create a folder named .vjsp/mcpServers in your workspace root directory

  2. Add a file named vjsp-docs-mcp.yaml to this folder

  3. Write the following content and save:

yaml
name: VJSP Documentation MCP
version: 0.0.1
schema: v1
mcpServers:
  - uses: dev/vjsp-docs-mcp

Enable Agent Mode

MCP servers only work in Agent mode. Make sure to switch to Agent mode in VJSP before testing.

Usage Examples

After configuration, you can use the MCP server to search VJSP documentation in the following ways:

plaintext
How to add Claude 4 Sonnet from Bedrock as a model in VJSP?
plaintext
Which context providers does VJSP support?
plaintext
How to add custom rules to VJSP configuration?

Troubleshooting

MCP Server Not Loading

  1. Check Configuration File: Ensure the uses field in the YAML configuration is correctly set to dev/vjsp-docs-mcp

  2. Confirm Mode Switch: MCP servers only support Agent mode, need to switch before use

  3. Restart VJSP: Try restarting the VJSP extension

No Search Results Returned

  1. Verify Network Connection: MCP servers require internet connection to search documentation

  2. Adjust Query Format: Try reorganizing the way search statements are phrased

  3. Test Known Topics: Search for functions clearly covered in documentation (like "model configuration") for verification

How to Configure MCP Servers

If you need to build custom MCP servers, please read the MCP Quick Start documentation first, then create mcpServers configuration, or add local MCP server configuration blocks to your configuration file:

yaml
# ...
mcpServers:
  - name: SQLite MCP
    command: npx
    args:
      - "-y"
      - "mcp-sqlite"
      - "/path/to/your/database.db"  # Your database file path
# ...

ⓘ If creating separate configuration files in the .vjsp/mcpServers/ directory, include necessary metadata fields (name, version, schema), as shown in the quick start example above.

MCP Server Property Configuration Description

MCP components include several additional properties specific to MCP servers:

  • name: Display name of the MCP server

  • type: MCP server type, optional values are sse, stdio, streamable-http

  • command: Command to start the MCP server

  • args: Arguments passed to the startup command

  • env: Environment variables injected into the command (for storing sensitive information like keys)

How to Choose MCP Transport Type

MCP currently supports HTTP-based transport methods to achieve remote server connections, breaking through the limitations of traditional local standard input/output (stdio) transport. This feature supports integration of cloud-hosted MCP servers and distributed architectures.

How to Use Server-Sent Events (SSE) Transport

For real-time streaming communication, use the SSE transport method:

yaml
# ...
mcpServers:
  - name: Server Name
    type: sse
    url: https://....  # Remote SSE server address
# ...

How to Use Standard Input/Output (stdio) Transport

For local MCP servers communicating via standard input/output:

yaml
# ...
mcpServers:
  - name: Server Name
    type: stdio
    command: npx
    args:
      - "@modelcontextprotocol/server-sqlite"
      - "/path/to/your/database.db"  # Your database file path
# ...

How to Use Streamable HTTP Transport

For standard HTTP communication supporting streaming:

yaml
# ...
mcpServers:
  - name: Server Name
    type: streamable-http
    url: https://....  # Remote HTTP server address
# ...

These remote transport options allow you to connect to MCP servers deployed on remote infrastructure, supporting more flexible deployment architectures and enabling multiple clients to share server resources.

How to Manage Keys in MCP Servers

Some MCP servers require the use of API keys or other sensitive information. You can utilize locally stored environment keys or access keys hosted in the Agent Hub. To use Hub keys, you can use the inputs property instead of secrets in the MCP's env configuration block.

yaml
# ...
mcpServers:
  - name: Supabase MCP
    command: npx
    args:
      - -y
      - "@supabase/mcp-server-supabase@latest"
      - --access-token
      - ${{ secrets.SUPABASE_TOKEN }}
    env:
      SUPABASE_TOKEN: ${{ secrets.SUPABASE_TOKEN }}
  - name: GitHub
    command: npx
    args:
      - "-y"
      - "@modelcontextprotocol/server-github"
    env:
      GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.GITHUB_PERSONAL_ACCESS_TOKEN }}
# ...