Skip to content

stack-fault/mrc-connector-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Building on MRC

MRC connectors let you plug your own services, games, bots, and tools directly into the MRC chat network. Your code connects over TLS, authenticates with a token, and sends and receives events in real time.

No special infrastructure required. A single Python script is enough to ship a fully working bot.


What can you build?

Anything that lives in an MRC room:

  • Games - poker, trivia, text adventures, RPGs, number puzzles
  • Bots - weather lookups, stock quotes, schedulers, dice rollers
  • Utilities - room moderators, greeting bots, announcement feeds
  • Interactive apps - menus, polls, scoreboards, leaderboards

With just the SDK and a few dozen lines of Python you can ship something that every user on the MRC network can interact with in real time.


Two connector modes

Mode Name Best for
1 Bot in a room Bots that participate in normal chat - announce, respond, moderate
2 App room Games and interactive apps where each user gets private, independent output

Get started

1. Request a connector token

Visit relaychat.net/ecosystem and fill out the request form. An MRC administrator will review your application and provide your auth token, slug, and connection details.

Please be a good citizen. MRC is a community built on trust. Connectors that spam, flood, harvest data, or degrade the experience for others will have their tokens revoked. Use common sense, respect other users, and build things that make MRC better for everyone.

2. Copy the SDK

Drop the mrc_connector/ directory next to your script. The SDK is stdlib-only - no pip installs needed.

my-project/
  mrc_connector/   <- copy from this folder
    __init__.py
    bot.py
    protocol.py
  my_bot.py

3. Write your bot and run it

See the example bots below and the full developer reference for code samples. The SDK handles TLS, auth, keepalive, and reconnection for you.


Example bots included

File Mode What it does
sample_bot.py 1 Announces the time, responds when mentioned, DM secret
guess_bot.py 2 Number-guessing game with per-user private sessions

Run either with:

CONNECTOR_TOKEN=<token> python3 examples/sample_bot.py

Next steps

See DEVELOPER_REFERENCE.md for the full technical documentation:

  • All event handlers and send methods
  • User metadata (terminal size, AFK, trust, display name)
  • MCI color codes for formatted output
  • Mode 2 session state and config options
  • MRC Trust enforcement
  • Permissions reference
  • Raw JSON protocol for non-Python implementations

See CHANGELOG.md for the version history of both the wire protocol and the Python SDK.


Questions, bugs, or ideas? Visit relaychat.net/ecosystem or drop by the MRC network.

About

MRC (Multi Relay Chat) Connector SDK

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages