Skip to content

Conversation

JLLeitschuh
Copy link
Contributor

Don't bind the sample server to 0.0.0.0 by default as that exposes the server to anyone else on the local network.

If anyone were to use these samples as staring points to build larger services, those servers would thus expose developers to attack immediately upon launch.

I'd prefer if we avoided that 😆

Motivation and Context

🔒 Security

How Has This Been Tested?

I haven't checked out the code locally to verify it works. All the editing to the code was done on GitHub.com

Breaking Changes

No.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Don't bind the sample server to `0.0.0.0` by default as that exposes the server to anyone else on the local network.

If anyone were to use these samples as staring points to build larger services, those servers would thus expose developers to attack immediately upon launch.

I'd prefer if we avoided that 😆
@Copilot Copilot AI review requested due to automatic review settings October 6, 2025 22:59
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the security of Kotlin MCP server samples by changing the default host binding from 0.0.0.0 to 127.0.0.1, preventing the server from being exposed to the local network by default.

  • Changed host parameter from 0.0.0.0 to 127.0.0.1 in embedded server configurations
  • Applied the change to both plain configuration and Ktor plugin implementations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@kpavlov kpavlov merged commit dcb4f21 into modelcontextprotocol:main Oct 8, 2025
3 checks passed
@devcrocod
Copy link
Contributor

relates to #232

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.

3 participants