mcp-go
A Go implementation of the Model Context Protocol (MCP), enabling seamless integration between LLM applications and external data sources and tools.
File Explorer
- bug_report.md
- config.yml
- documentation-improvement.md
- feature-request.md
- ci.yml
- golangci-lint.yml
- pages.yml
- release.yml
- pull_request_template.md
- code-audit.md
- commit-push.md
- create-pr.md
- feature-request.md
- file-issue.md
- fix-issue.md
- new-prompt.md
- release-tagger.md
- resolve-reviews.md
- review-pr.md
- update-docs.md
- command.go
- command_test.go
- constants.go
- error.go
- idempotent_all_transports_test.go
- inprocess.go
- interface.go
- logging.go
- logging_test.go
- oauth.go
- oauth_nil_metadata_test.go
- oauth_test.go
- oauth_utils.go
- oauth_utils_test.go
- panic_recovery_test.go
- sse.go
- sse_oauth_test.go
- sse_test.go
- stdio.go
- stdio_idempotent_test.go
- stdio_test.go
- streamable_http.go
- streamable_http_bodyclose_test.go
- streamable_http_oauth_test.go
- streamable_http_sampling_test.go
- streamable_http_test.go
- utils.go
- utils_test.go
- client.go
- client_edge_cases_test.go
- elicitation.go
- elicitation_test.go
- http.go
- http_test.go
- inprocess.go
- inprocess_elicitation_test.go
- inprocess_sampling_test.go
- inprocess_test.go
- interface.go
- issue583_test.go
- iter.go
- iter_test.go
- mrtr.go
- oauth.go
- oauth_test.go
- protocol.go
- protocol_negotiation_test.go
- review_regression_test.go
- roots.go
- sampling.go
- sampling_test.go
- sse.go
- sse_test.go
- stdio.go
- stdio_test.go
- subscriptions.go
- tracing.go
- tracing_test.go
- protocol_2026_07_28_test.go
- resumability_http_test.go
- sampling_http_test.go
- scoped_request_resumability_test.go
- main.go
- main.go
- main.go
- id.go
- main.go
- main.go
- main.go
- main.go
- README.md
- main.go
- main.go
- README.md
- main.go
- main.go
- main.go
- main.go
- main.go
- README.md
- main.go
- README.md
- main.go
- README.md
- main.go
- README.md
- main.go
- main.go
- README.md
- main.go
- main.go
- base_metadata_test.go
- consts.go
- content_benchmark_test.go
- discover.go
- elicitation_test.go
- elicitation_validation_test.go
- error_unmarshal_test.go
- errors.go
- errors_additional_test.go
- errors_test.go
- headers.go
- headers_test.go
- icons_test.go
- meta.go
- mrtr.go
- mrtr_test.go
- prompts.go
- prompts_test.go
- resources.go
- resources_test.go
- result.go
- schema_cache.go
- schema_cache_test.go
- struct_schema.go
- struct_schema_test.go
- tasks.go
- tasks_test.go
- tools.go
- tools_additional_test.go
- tools_defer_loading_test.go
- tools_properties_test.go
- tools_test.go
- typed_tools.go
- typed_tools_additional_test.go
- typed_tools_test.go
- types.go
- types_test.go
- utils.go
- utils_additional_test.go
- utils_helpers_test.go
- utils_test.go
- version.go
- version_test.go
- mcptest.go
- mcptest_sampling_elicitation_test.go
- mcptest_test.go
- main.go
- README.md
- client_test.go
- go.mod
- go.sum
- logger.go
- logger_test.go
- meta_carrier.go
- meta_carrier_test.go
- options.go
- README.md
- server_test.go
- tracer.go
- data.go
- hooks.go.tmpl
- main.go
- README.md
- request_handler.go.tmpl
- cacheable_results.txtar
- discover.txtar
- legacy_unchanged.txtar
- missing_capabilities.txtar
- mrtr.txtar
- removed_methods.txtar
- resource_not_found.txtar
- unsupported_version.txtar
- client_info_store.go
- client_info_store_test.go
- completion.go
- conformance_test.go
- constants.go
- ctx.go
- discover.go
- elicitation.go
- elicitation_test.go
- errors.go
- event_store.go
- hooks.go
- http_cors.go
- http_cors_test.go
- http_localhost.go
- http_localhost_test.go
- http_transport_options.go
- inprocess_session.go
- input_validation.go
- input_validation_test.go
- jsonrpc_error.go
- logger.go
- logger_test.go
- mrtr.go
- mrtr_test.go
- output_validation.go
- output_validation_test.go
- param_headers_test.go
- protected_resource.go
- protected_resource_test.go
- protocol.go
- request_handler.go
- resource_errors.go
- resource_subscribe_test.go
- resource_test.go
- response.go
- roots.go
- roots_test.go
- sampling.go
- sampling_test.go
- server.go
- server_additional_test.go
- server_race_test.go
- server_test.go
- session.go
- session_hook_panic_test.go
- session_resource_helpers_test.go
- session_resource_templates_test.go
- session_test.go
- sse.go
- sse_panic_test.go
- sse_test.go
- stdio.go
- stdio_panic_test.go
- stdio_test.go
- streamable_http.go
- streamable_http_client_info_test.go
- streamable_http_elicitation_test.go
- streamable_http_handle.go
- streamable_http_handle_test.go
- streamable_http_modern.go
- streamable_http_modern_test.go
- streamable_http_resume.go
- streamable_http_sampling_error_label_test.go
- streamable_http_sampling_test.go
- streamable_http_test.go
- strict_input_schema_default_test.go
- subscriptions.go
- subscriptions_test.go
- task_hooks.go
- task_hooks_test.go
- task_limit_test.go
- task_panic_test.go
- task_response_format_test.go
- task_test.go
- task_tool_test.go
- tool_filter_call_test.go
- tracing.go
- tracing_test.go
- version_test.go
- mockstdio_server.go
- tracing.go
- tracing_test.go
- advanced-sampling.mdx
- basics.mdx
- index.mdx
- operations.mdx
- transports.mdx
- advanced-sampling.mdx
- advanced.mdx
- basics.mdx
- completions.mdx
- elicitation.mdx
- index.mdx
- middleware.mdx
- prompts.mdx
- resources.mdx
- tasks.mdx
- tools.mdx
- http.mdx
- index.mdx
- inprocess.mdx
- sse.mdx
- stdio.mdx
- core-concepts.mdx
- getting-started.mdx
- index.mdx
- protocol-2026-07-28.mdx
- quick-start.mdx
- logo.png
- styles.css
- .gitignore
- bun.lock
- package.json
- README.md
- tsconfig.json
- vocs.config.ts
- .gitignore
- .golangci.yml
- AGENTS.md
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
- go.mod
- go.sum
- LICENSE
- logo.png
- README.md
- SECURITY.md
# Installation Guide
goSetup Steps
go get github.com/mark3labs/mcp-go
Add the mcp-go library as a dependency to your project.
go run main.go
Run your MCP server or example file.
Video Guides
Tutorial
Key Commands
go get github.com/mark3labs/mcp-go
Install the mcp-go package into your project.
go run main.go
Build and run the Go program immediately.
# Use via CDN
jsDelivrjsDelivr serves any public GitHub repository as a CDN with zero setup. Pick a version and a file to get a ready-to-paste link and snippet.
Command Glossary
Commands referenced in this DOCs, explained below.
fmt
View Details ▼
fmt
Reformat a text file by joining its paragraphs and limiting the line width to a number of characters (75 by default).
fmt {{path/to/file}}
Reformat a file:
fmt {{[-w|--width]}} {{n}} {{path/to/file}}
Reformat a file producing output lines of (at most) `n` characters:
fmt {{[-s|--split-only]}} {{path/to/file}}
Reformat a file without joining lines shorter than the given width together:
go generate
View Details ▼
go generate
Generate Go files by running commands within source files.
go generate
Generate Go files by running commands within source files:
go get
View Details ▼
go get
Add a dependency package, or download packages in legacy GOPATH mode.
Note: `./...` is a Go package pattern understood by Go tooling. It matches the current package and all packages recursively under the current directory.
go get {{example.com/pkg}}
Add a specified package to `go.mod` in module-mode or install the package in GOPATH-mode:
go get {{example.com/pkg}}@{{v1.2.3}}
Modify the package with a given version in module-aware mode:
go get {{example.com/pkg}}@{{none}}
Remove a specified package:
goimports
View Details ▼
goimports
Update Go import lines, adding missing ones and removing unreferenced ones.
goimports {{path/to/file.go}}
Display the completed import source file:
goimports -w {{path/to/file.go}}
Write the result back to the source file instead of `stdout`:
goimports -w -d {{path/to/file.go}}
Display diffs and write the result back to the source file:
select
View Details ▼
select
Bash builtin construct for creating menus.
select {{word}} in {{apple orange pear banana}}; do echo ${{word}}; done
Create a menu out of individual words:
select {{line}} in $({{command}}); do echo ${{line}}; done
Create a menu from the output of another command:
PS3="{{Select a file: }}"; select {{file}} in *; do echo ${{file}}; done
Specify the prompt string for `select` and create a menu for picking a file or folder from the current directory:
Task
View Details ▼
Task
To-do list manager.
task add {{description}} due:{{tomorrow}}
Add a new task which is due tomorrow:
task {{task_id}} modify priority:{{H|M|L}}
Update a task's priority:
task {{task_id}} done
Complete a task:
