Skip to content
Merged
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
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ RUN chmod +x /usr/bin/pathfinder
RUN chmod +x /usr/bin/entrypoint.sh

LABEL maintainer="shiva@shivasurya.me"
LABEL io.modelcontextprotocol.server.name="dev.codepathfinder/pathfinder"

ENTRYPOINT ["/usr/bin/entrypoint.sh"]
2 changes: 2 additions & 0 deletions python-sdk/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!-- mcp-name: dev.codepathfinder/pathfinder -->

# Code Pathfinder Python SDK

Write security rules in Python for Code Pathfinder, an open-source security scanner that combines structural code analysis with AI-powered vulnerability detection.
Expand Down
2 changes: 1 addition & 1 deletion python-sdk/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "codepathfinder"
version = "1.3.6"
version = "1.3.7"
description = "Python SDK for code-pathfinder static analysis for modern security teams"
readme = "README.md"
requires-python = ">=3.8"
Expand Down
2 changes: 1 addition & 1 deletion sast-engine/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.6
1.3.7
1 change: 1 addition & 0 deletions sast-engine/cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func runServe(cmd *cobra.Command, _ []string) error {

// Create server with empty index (will be populated by background indexing)
server := mcp.NewServerWithBackgroundIndexing(projectPath, pythonVersion, disableAnalytics)
server.SetVersion(Version)

// Start indexing in background goroutine
go func() {
Expand Down
16 changes: 14 additions & 2 deletions sast-engine/mcp/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,20 @@ type Server struct {
degradation *GracefulDegradation
analytics *Analytics
disableAnalytics bool
version string

// Go-specific context for stdlib metadata in MCP tool responses.
// Set via SetGoContext after the Go call graph is built.
goVersion string
goModuleRegistry *core.GoModuleRegistry
}

// SetVersion sets the server version reported in MCP initialize responses.
// Should be called with cmd.Version (injected via ldflags at build time).
func (s *Server) SetVersion(version string) {
s.version = version
}

// SetGoContext stores the Go version and module registry so that MCP tool
// responses can include stdlib metadata (is_stdlib, signature, return_type,
// etc.) for Go standard library calls.
Expand Down Expand Up @@ -244,11 +251,16 @@ func (s *Server) handleInitialize(req *JSONRPCRequest) *JSONRPCResponse {
s.analytics.ReportClientConnected(params.ClientInfo.Name, params.ClientInfo.Version)
}

version := s.version
if version == "" {
version = "dev"
}

return SuccessResponse(req.ID, InitializeResult{
ProtocolVersion: "2024-11-05",
ServerInfo: ServerInfo{
Name: "pathfinder",
Version: "0.1.0-poc",
Name: "dev.codepathfinder/pathfinder",
Version: version,
},
Capabilities: Capabilities{
Tools: &ToolsCapability{
Expand Down
4 changes: 2 additions & 2 deletions sast-engine/mcp/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ func TestHandleInitialize(t *testing.T) {
result, ok := resp.Result.(InitializeResult)
require.True(t, ok)
assert.Equal(t, "2024-11-05", result.ProtocolVersion)
assert.Equal(t, "pathfinder", result.ServerInfo.Name)
assert.Equal(t, "0.1.0-poc", result.ServerInfo.Version)
assert.Equal(t, "dev.codepathfinder/pathfinder", result.ServerInfo.Name)
assert.Equal(t, "dev", result.ServerInfo.Version)
assert.NotNil(t, result.Capabilities.Tools)
}

Expand Down
4 changes: 2 additions & 2 deletions sast-engine/mcp/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ func TestInitializeResult_Serialization(t *testing.T) {
result := InitializeResult{
ProtocolVersion: "2024-11-05",
ServerInfo: ServerInfo{
Name: "pathfinder",
Version: "0.1.0-poc",
Name: "dev.codepathfinder/pathfinder",
Version: "1.3.7",
},
Capabilities: Capabilities{
Tools: &ToolsCapability{ListChanged: true},
Expand Down
44 changes: 44 additions & 0 deletions server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
"name": "dev.codepathfinder/pathfinder",
"title": "Code Pathfinder",
"description": "Code intelligence MCP server: call graphs, type inference, and symbol search for Python/Go.",
"repository": {
"url": "https://github.com/shivasurya/code-pathfinder",
"source": "github"
},
"version": "1.3.7",
"packages": [
{
"registryType": "pypi",
"identifier": "codepathfinder",
"version": "1.3.7",
"transport": {
"type": "stdio"
},
"packageArguments": [
{
"type": "positional",
"value": "serve",
"description": "Start the MCP server",
"isRequired": true
},
{
"type": "named",
"name": "--project",
"description": "Project root to index (defaults to current directory)",
"isRequired": false,
"default": ".",
"format": "filepath"
}
]
},
{
"registryType": "oci",
"identifier": "docker.io/shivasurya/code-pathfinder:v1.3.7",
"transport": {
"type": "stdio"
}
}
]
}
Loading