Skip to content

Conversation

@juananpe
Copy link

This PR fixes (#6) an issue where MCP tool schemas generated by github.com/invopop/jsonschema used JSON Schema Draft 2020-12 features (notably $dynamicRef), which are not supported by VS Code. This caused runtime warnings and prevented the Telegram MCP tools from working in VSCode.

Patch:

Added an override in serve.go to force the schema generator to emit Draft-07 schemas:

import "github.com/invopop/jsonschema"

const jsonSchemaDraft07 = "https://json-schema.org/draft-07/schema#"

func init() {
    jsonschema.Version = jsonSchemaDraft07
}

How to build:

go build -o bin/telegram-mcp ./

Run the server and authenticate:

./bin/telegram-mcp auth --app-id <your-app-id> --api-hash <your-api-hash> --phone <your-phone> --password <your-2fa-password> --new

Use this MCP entry in VSCode (replace with your pathname or add it to your $PATH)

 	"telegram": {
			"command": "/opt/telegram-mcp/bin/telegram-mcp",
			"env": {
				"TG_APP_ID": "XXXXX",
				"TG_API_HASH": "YYYYY"
			},
			"type": "stdio"
		}

@juananpe
Copy link
Author

@chaindead Think you could give this a quick look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant