Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: ["1.23", "1.24", "1.25"]
go: ["1.24", "1.25"]
steps:
- name: Check out code
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ The following table shows which versions of the Go SDK support which versions of
| v1.2.0+ | 2025-06-18 | 2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05 |
| v1.0.0 - v1.1.0 | 2025-06-18 | 2025-06-18, 2025-03-26, 2024-11-05 |

New releases of the SDK target only supported versions of Go. See
https://go.dev/doc/devel/release#policy for more information.

## Getting started

To get started creating an MCP server, create an `mcp.Server` instance, add
Expand Down
3 changes: 3 additions & 0 deletions internal/readme/README.src.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ The following table shows which versions of the Go SDK support which versions of
| v1.2.0+ | 2025-06-18 | 2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05 |
| v1.0.0 - v1.1.0 | 2025-06-18 | 2025-06-18, 2025-03-26, 2024-11-05 |

New releases of the SDK target only supported versions of Go. See
https://go.dev/doc/devel/release#policy for more information.

## Getting started

To get started creating an MCP server, create an `mcp.Server` instance, add
Expand Down
17 changes: 17 additions & 0 deletions mcp/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,23 @@ func computeURIFilepath(rawURI, dirFilepath string, rootFilepaths []string) (str
return uriFilepathRel, nil
}

// withFile calls f on the file at join(dir, rel),
// protecting against path traversal attacks.
func withFile(dir, rel string, f func(*os.File) error) (err error) {
r, err := os.OpenRoot(dir)
if err != nil {
return err
}
defer r.Close()
file, err := r.Open(rel)
if err != nil {
return err
}
// Record error, in case f writes.
defer func() { err = errors.Join(err, file.Close()) }()
return f(file)
}

// fileRoots transforms the Roots obtained from the client into absolute paths on
// the local filesystem.
// TODO(jba): expose this functionality to user ResourceHandlers,
Expand Down
29 changes: 0 additions & 29 deletions mcp/resource_go124.go

This file was deleted.

25 changes: 0 additions & 25 deletions mcp/resource_pre_go124.go

This file was deleted.

Loading