Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/internal/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,5 @@ func ServeFlags(flags *pflag.FlagSet, opts *ToolboxOptions) {
flags.StringVar(&opts.Cfg.McpPrmFile, "mcp-prm-file", "", "Path to a manual Protected Resource Metadata (PRM) JSON file. If provided, overrides auto-generation.")
flags.StringSliceVar(&opts.Cfg.AllowedOrigins, "allowed-origins", []string{"*"}, "Specifies a list of origins permitted to access this server. Defaults to '*'.")
flags.StringSliceVar(&opts.Cfg.AllowedHosts, "allowed-hosts", []string{"*"}, "Specifies a list of hosts permitted to access this server. Defaults to '*'.")
flags.BoolVar(&opts.Cfg.EnableDraftSpecs, "enable-draft-specs", false, "Opt-in and test upcoming draft MCP specifications.")
}
39 changes: 39 additions & 0 deletions docs/en/documentation/introduction/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -762,3 +762,42 @@ For more detailed instructions on using the Toolbox Go SDK, see the
[README](https://github.com/googleapis/mcp-toolbox-sdk-go/blob/main/core/README.md).

For more details, see the [Agent Skills guide](https://mcp-toolbox.dev/documentation/configuration/skills/).

## Supported MCP Version

Toolbox is fully compatible with the Model Context Protocol (MCP) and maintains support for multiple protocol revisions to ensure seamless integration with most MCP clients.

### Stable Releases
The following official MCP specification versions are currently supported for production use:

* `2025-11-25`
* `2025-06-18`
* `2025-03-26`
* `2024-11-05`

{{< notice note >}}
If no protocol version is negotiated or provided, the Toolbox server defaults to
the legacy custom transport protocol established on `2024-11-05`, which does not
require initialization.
{{< /notice >}}

### Draft Specifications
We actively develop against upcoming protocol specifications. You can opt-in to
test these forthcoming revisions before their official release using the
`--enable-draft-specs` flag during server startup.

To test these draft specifications, enable the startup flag and use this version
string during negotiation:
Comment thread
Yuan325 marked this conversation as resolved.
* `DRAFT-2026-v1`

Description: Enables experimental support for upcoming draft MCP specifications,
allowing you to test new schema standards and transport adjustments before they
become stable.

{{< notice note >}}
Once the draft specification is finalized and released as a stable version, the
Comment thread
Yuan325 marked this conversation as resolved.
draft implementation will be permanently removed. There will be no automatic
redirects or backwards compatibility from the draft spec to the stable release.
Developers must manually migrate their clients to the stable version once it is
available. Do not use this flag in production environments.
{{< /notice >}}
3 changes: 2 additions & 1 deletion docs/en/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description: >
| `-a` | `--address` | Address of the interface the server will listen on. | `127.0.0.1` |
| | `--disable-reload` | Disables dynamic reloading config. | |
| `-h` | `--help` | help for toolbox | |
| | `--ignore-unknown-tools` | Log warnings and skip unknown/unsupported tool types instead of failing to start. | |
| | `--ignore-unknown-tools` | Log warnings and skip unknown/unsupported tool types instead of failing to start. | |
| | `--log-level` | Specify the minimum level logged. Allowed: 'DEBUG', 'INFO', 'WARN', 'ERROR'. | `info` |
| | `--logging-format` | Specify logging format to use. Allowed: 'standard' or 'JSON'. | `standard` |
| | `--mcp-prm-file` | Path to a manual Protected Resource Metadata (PRM) JSON file. If provided, overrides auto-generation for MCP Server-Wide Authentication. | |
Expand All @@ -35,6 +35,7 @@ description: >
| | `--allowed-hosts` | Specifies a list of hosts permitted to access this server to prevent DNS rebinding attacks. | `*` |
| | `--user-agent-metadata` | Appends additional metadata to the User-Agent. | |
| | `--poll-interval` | Specifies the polling frequency (seconds) for configuration file updates. | `0` |
| | `--enable-draft-specs` | Opt-in and test upcoming draft MCP specifications. | `false` |
| `-v` | `--version` | version for toolbox | |

## Sub Commands
Expand Down
2 changes: 2 additions & 0 deletions internal/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ type ServerConfig struct {
UserAgentMetadata []string
// PollInterval sets the polling frequency for configuration file updates.
PollInterval int
// EnableDraftSpecs allow users to opt-in and test upcoming draft MCP specs.
EnableDraftSpecs bool
}

type logFormat string
Expand Down
4 changes: 2 additions & 2 deletions internal/server/mcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ func processMcpMessage(ctx context.Context, body []byte, s *Server, protocolVers
version = mcputil.LATEST_PROTOCOL_VERSION
}

result, err := mcp.ProcessMethod(ctx, version, baseMessage.Id, baseMessage.Method, tools.Toolset{}, prompts.Promptset{}, nil, body, nil)
result, err := mcp.ProcessMethod(ctx, s.enableDraftSpecs, version, baseMessage.Id, baseMessage.Method, tools.Toolset{}, prompts.Promptset{}, nil, body, nil)
Comment thread
Yuan325 marked this conversation as resolved.
if err != nil {
span.SetStatus(codes.Error, err.Error())
if rpcErr, ok := result.(jsonrpc.JSONRPCError); ok {
Expand Down Expand Up @@ -843,7 +843,7 @@ func processMcpMessage(ctx context.Context, body []byte, s *Server, protocolVers
span.SetAttributes(attribute.String("error.type", metricErrorType))
return "", rpcErr, err
}
result, err := mcp.ProcessMethod(ctx, protocolVersion, baseMessage.Id, baseMessage.Method, toolset, promptset, s.ResourceMgr, body, header)
result, err := mcp.ProcessMethod(ctx, s.enableDraftSpecs, protocolVersion, baseMessage.Id, baseMessage.Method, toolset, promptset, s.ResourceMgr, body, header)
if err != nil {
span.SetStatus(codes.Error, err.Error())
// Set error.type based on JSON-RPC error code
Expand Down
13 changes: 5 additions & 8 deletions internal/server/mcp/mcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"encoding/json"
"fmt"
"net/http"
"slices"

"github.com/googleapis/mcp-toolbox/internal/prompts"
"github.com/googleapis/mcp-toolbox/internal/server/mcp/jsonrpc"
Expand Down Expand Up @@ -47,10 +46,13 @@ func NotificationHandler(ctx context.Context, body []byte) error {

// ProcessMethod returns a response for the request.
// This is the Operation phase of the lifecycle for MCP client-server connections.
func ProcessMethod(ctx context.Context, mcpVersion string, id jsonrpc.RequestId, method string, toolset tools.Toolset, promptset prompts.Promptset, resourceMgr *resources.ResourceManager, body []byte, header http.Header) (any, error) {
func ProcessMethod(ctx context.Context, enableDraftSpecs bool, mcpVersion string, id jsonrpc.RequestId, method string, toolset tools.Toolset, promptset prompts.Promptset, resourceMgr *resources.ResourceManager, body []byte, header http.Header) (any, error) {
switch mcpVersion {
case mcputil.VERSION_DRAFT:
return vdraft.ProcessMethod(ctx, id, method, toolset, promptset, resourceMgr, body, header)
if enableDraftSpecs {
return vdraft.ProcessMethod(ctx, id, method, toolset, promptset, resourceMgr, body, header)
}
return jsonrpc.NewUnsupportedProtocolVersionError(id, mcpVersion)
case mcputil.VERSION_20251125:
return v20251125.ProcessMethod(ctx, id, method, toolset, promptset, resourceMgr, body, header)
case mcputil.VERSION_20250618:
Expand All @@ -63,8 +65,3 @@ func ProcessMethod(ctx context.Context, mcpVersion string, id jsonrpc.RequestId,
return jsonrpc.NewUnsupportedProtocolVersionError(id, mcpVersion)
}
}

// VerifyProtocolVersion verifies if the version string is valid.
func VerifyProtocolVersion(version string) bool {
return slices.Contains(mcputil.SUPPORTED_PROTOCOL_VERSIONS, version)
}
6 changes: 6 additions & 0 deletions internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ type Server struct {
sseManager *sseManager
ResourceMgr *resources.ResourceManager
mcpPrmFile string
enableDraftSpecs bool
}

func InitializeConfigs(ctx context.Context, cfg ServerConfig) (
Expand Down Expand Up @@ -403,6 +404,11 @@ func NewServer(ctx context.Context, cfg ServerConfig) (*Server, error) {
ResourceMgr: resourceManager,
toolboxUrl: cfg.ToolboxUrl,
mcpPrmFile: cfg.McpPrmFile,
enableDraftSpecs: cfg.EnableDraftSpecs,
}

if s.enableDraftSpecs {
s.logger.WarnContext(ctx, "Flag --enable-draft-specs is active. Please note that draft specs are subject to breaking changes and will be completely removed (not redirected) once stable MCP specifications are released. Do not use this configuration in production.")
}

// cors
Expand Down
Loading