SwiftApi: Remote Minecraft Server Management via Apache Thrift

What is SwiftApi? Imagine controlling your Minecraft server from a website, a mobile app, or a custom dashboard without ever touching the console. SwiftApi makes this a reality. It is an Apache Thrift-based API designed specifically for CraftBukkit servers, allowing you to call Bukkit methods ove...

Download SwiftApi

Original name: SwiftApi

FileVersionLoaderSize
SwiftApi-0.2.jar——1023 КБDownload
SwiftApi-0.3.jar——1.0 МБDownload
SwiftApi.jar——1.4 МБDownload

What is SwiftApi?

Imagine controlling your Minecraft server from a website, a mobile app, or a custom dashboard without ever touching the console. SwiftApi makes this a reality. It is an Apache Thrift-based API designed specifically for CraftBukkit servers, allowing you to call Bukkit methods over the internet using almost any programming language you prefer. The plugin acts as the server-side component, exposing a powerful interface that your client programs can connect to, whether you are building a web-based admin panel, a statistics tracker, or a fully automated moderation tool.

How SwiftApi Bridges Minecraft and External Applications

Traditional server management often means logging into the console or using limited in-game commands. SwiftApi shatters those boundaries by translating Bukkit’s internal functions into a language-agnostic service. Once installed, your CraftBukkit server listens on a configurable port for Thrift requests. You can then write a client in Python, PHP, C#, Java, or dozens of other languages to retrieve player lists, send messages, manage inventories, or even interact with economy plugins through the SwiftApiVault extension.

The Power of Apache Thrift

Apache Thrift is the backbone of SwiftApi. It handles the serialization and transport of complex data types, meaning you can work with native Bukkit objects like Player or World directly in your client code. The Thrift compiler generates ready-to-use libraries from a simple definition file, so you never have to manually parse JSON or craft raw network packets. This abstraction saves hours of development time and opens the door to creative integrations that were once cumbersome to build.

SwiftApi 2.0 and Vault Integration

The latest alpha release, SwiftApi 2.0, brings improved stability and performance. Alongside it, SwiftApiVault 1.0-alpha unlocks full economy and permissions management via the popular Vault plugin. Now you can check balances, withdraw funds, or adjust permission groups directly from your external app, making it perfect for server networks that need centralized control.

Setting Up SwiftApi on Your Server

Getting started is straightforward. Download the plugin from the official BukkitDev page and place the JAR file into your server’s plugins folder. After a restart, a configuration file will appear at plugins/SwiftApi/config.yml. You must edit this file immediately to secure your server.

Configuration Essentials

Inside the config, three values demand your attention: username, password, and salt. The defaults are admin, password, and saltines. Leaving them unchanged is a massive security risk because anyone who discovers your server’s IP and the API port could gain full control. Choose a strong, unique password and a random salt string. You can also adjust the listening port (default 21111) if needed.

Installation Tips

While manual plugin installation works fine, many server owners prefer a streamlined approach. For those who want to skip the hassle of dragging files and editing configs through FTP, this mod can be easily installed via the foxygame.net launcher — a convenient, flexible, and modern Minecraft launcher where you can download mods right from the menu. It handles the entire setup process with a few clicks, so you can focus on writing your client app instead of wrestling with file permissions.

Building Your First Client Application

Once the server is running and secured, you can start coding. The first step is to download the Apache Thrift compiler and the SwiftApi.thrift file from the plugin’s repository. This definition file describes every available method and data structure.

Generating the Client Library

Open a terminal and run a command like thrift -r --gen csharp SwiftApi.thrift. The -r flag ensures all included dependencies are processed, while --gen csharp specifies the target language. Replace csharp with py, php, java, or any other supported language. The compiler will produce a folder containing all the source files you need. Simply include these files in your project, and you are ready to connect.

A Quick C# Example

Here is a minimal C# snippet that connects to a server and prints its version:

TSocket socket = new TSocket("your.bukkitserver.org", 21111);
socket.Open();
TBinaryProtocol protocol = new TBinaryProtocol(new TFramedTransport(socket));
SwiftApi.Client client = new SwiftApi.Client(protocol);
Console.WriteLine("Server Version: " + client.getServerVersion(authString));
socket.Close();

The authString is a hashed combination of your username, password, and salt, generated according to the plugin’s documentation. Once authenticated, you can call any method, from getOnlinePlayers() to broadcastMessage(). Because Thrift preserves complex types, a method like getPlayer(string name) returns a full Player object with health, location, and inventory data, all accessible in your native code.

Supported Programming Languages

Apache Thrift’s versatility is one of SwiftApi’s greatest strengths. As of version 0.9.0, the compiler can generate client libraries for over 15 languages, including:

  • ActionScript 3
  • C, C++, C#
  • Objective-C (Cocoa)
  • Delphi
  • Erlang
  • Go
  • Haskell
  • Java
  • JavaScript
  • OCaml
  • Perl
  • PHP
  • Python (with Twisted async support)
  • Ruby
  • Smalltalk

This means your team can build a monitoring tool in Python, a web dashboard in PHP, and a mobile app in Objective-C, all talking to the same Minecraft server through SwiftApi.

Expanding the Possibilities

The real magic happens when you combine SwiftApi with other plugins and external services. For example, you could create a Discord bot that listens for chat messages via SwiftApi and relays them to a channel, or an automatic backup script that saves the world before a scheduled restart. The open-source nature of the project encourages community contributions; you can fork the repository on Bitbucket and submit pull requests to add new features or fix bugs. Anonymous usage statistics are sent to mcstats.org by default, but you can opt out by editing plugins/PluginMetrics/config.yml.

Conclusion

SwiftApi transforms your CraftBukkit server into a programmable hub, ready to be integrated with any external system you can imagine. By leveraging Apache Thrift, it eliminates the language barrier and lets you work with familiar tools while maintaining full access to Bukkit’s rich API. Whether you are a solo developer tinkering with a small server or an admin managing a large network, SwiftApi provides the flexibility and power to build truly custom Minecraft experiences. Secure your configuration, generate your client library, and start coding — the only limit is your creativity.